我在apache.Now中使用wordpress时遇到了很大的麻烦,我需要重写我的网址。我试着用这个.htaccess文件的代码
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /shopboxcms/
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
RewriteCond %{REQUEST_FILENAME} !main\.php
RewriteRule . - [L]
RewriteRule ^wp-admin\/widgets111\.html$ /wordpress/wp-admin/widgets.php
RewriteRule ^hai$ http://localhost/shopboxcms/index.php?productid=62953
</IfModule>但是当我们尝试调用http://localhost/shopboxcms/hai时,通过使用这个.htaccess文件,它显示了http://localhost/shopboxcms/?productid=62953,但我需要相反的结果。我该怎么解决它呢?
发布于 2010-03-04 20:43:05
我得到了答案:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php
RewriteCond %{REQUEST_FILENAME} !main\.php
RewriteRule . - [L]
RewriteRule ^[A-Za-z-0-9,"'-]+\-([0-9]+)$ demo/index.php?productid=$1
</IfModule>https://stackoverflow.com/questions/2378385
复制相似问题