Mod Rewrite rules for a subdirectory
I have a drupal installation set up in a subdirectory of a domain (www.mydomain.com/cms), but I'm having trouble getting the queries to format correctly using mod_rewrite. I need url requests coming in as:
{domain}/cms/admin/content/node to be interpreted as: {domain}/cms/?q=admin/content/nodeHere's what I have:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCon开发者_StackOverflow中文版d %{REQUEST_URI} !=/favicon.ico
RewriteCond %{REQUEST_URI} ^/(cms/.*)$
RewriteRule ^(.*)$ cms/?q=$1 [L,QSA]
Any pointers on where I'm going wrong?
Where these rules you posted are located? If you create a .htaccess inside the "cms" directory with the following content, I believe it should work fine:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
精彩评论