Forum Moderators: phranque
eg
folder a htaccess
RewriteEngine on
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_URI} !//
RewriteRule (.*)/(.*)/(.*)/(.*) $1.php?id=$3&page=$4&name=$2 [L]
this works fine for the files in folder a, but I need a rule like this
RewriteEngine on
RewriteCond %{REQUEST_URI} !\.
RewriteCond %{REQUEST_URI} !//
RewriteRule (folder a)(.*)/(.*)/(.*)/(.*) $1.php?id=$3&page=$4&name=$2 [L]
for the OLD folder
can not get the syntax right.
anyone?
See the comments in [webmasterworld.com...] from just a few hours ago.
When you say you want to "move folder"...
Do you want to move the files around on the server but keep the same URLs, or
Do you want to keep the files in the same place on the server but change the URLs?
That isn't clear from your question.
Mod_rewrite cannot change URLs - URLs are defined by the links on your pages.
If you are moving to new URLs you should also set up a redirect so that requests for the old URLs are redirected to the new URLs.
It is a very bad idea to change all the URLs. In this case it looks like a rewrite could be used such that you keep the same old URLs and the rewrite connects that URL request to the new internal location of the files within the server without revealing what that location actually is.
We need to know what will change in the URL from the old URL to the new URL, and what will change in the filesystem from old filepath to new filepath, so please make this clear.
Otherwise, you may get an exquisitely-detailed, beautifully-elegant, and perfect solution to the wrong question...
Jim