我有一个aplhanumeric分页,并希望有漂亮的URL
在页面上http://www.mysite.com/glossary/
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F | G | H |我| J | K | L | M | N | O | P |问| R | S | T | U | V | W | X | Y | Z
Apple
Alicia
Amy
A sweet Candy
.
.
.
.
and so on
aplha数字上的当前网址有一个http://www.mysite.com/glossary/?list=a
我希望有这个
http://www.mysite.com/a
http://www.mysite.com/b
http://www.mysite.com/c
and so on.. .
关于如何在.htacess
url重写中对此进行编码以实现该网址的任何想法?
更新
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /mysite/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /mysite/index.php [L]
</IfModule>
# END WordPress
RewriteEngine on
RewriteRule ^/mysite/([^/\.]+)/?$ glossary/?list==$1 [L]
由于
答案 0 :(得分:0)
尝试
RewriteEngine On
RewriteRule ^([^/]*)\.html$ /glossary/?list=$1 [L]
答案 1 :(得分:0)
试试这个并告诉我它是否有效:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /mysite/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9a-z]{1})$ glossary/?list=$1 [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /mysite/index.php [L]
</IfModule>
如果不起作用,请尝试:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /mysite/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/([0-9a-z]{1})$ glossary/?list=$1 [NC,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /mysite/index.php [L]
</IfModule>