0
我试图设置一个php服务器在“/”目录下工作的本地实例。我的本地实例将在我的开发环境中的“/子目录/”中工作。htaccess从子目录重定向到子目录
我试着翻译的.htaccess来适应这一点,但我总是得到404这是原来的.htaccess:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^my-nice-url$ /index.php?p=ugly_url
而这些是我的尝试:
RewriteEngine on
RewriteBase /mylocaldirectory/
# Not in local! RewriteCond %{HTTP_HOST} ^example.com$ [NC]
# Not in local! RewriteRule ^(.*)$ http://www.example.com/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^my-nice-url$ /index.php?p=ugly_url
而且
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)my-nice-url$ /index.php?p=ugly_url
谢谢
我仍然得到一个404,在我的apache日志中,我看到文件不存在:C:/wwwroot2/example.com/my-nice-url这是事实,它不存在,但我想index.php? p = ugly_url出现 – 2012-04-03 10:41:17