htaccess mod_rewrite issue
I have a client that has an htaccess file that rewrites his url from mydomain/somepage.php to mydomain/somepage. It's working fine in his root folder. I need to re-design his site so I'm trying to build it in a new folder. I copied the htaccess file into the new folder, but it doesn't seem to recognize the re-written URLs. Here is the content of the htaccess file:
RewriteRule ^equipment/(.*)$ equipment_category.php?id=$1
RewriteRule ^browse/(.*)$ equipment_category.php?keyword=$1
RewriteRule ^product/(.*)$ equipment_product.php?code=$1
RewriteRule ^product/s/(.*)$ equipment_product.php?op=s&code=$1
Since this file is in the new folder, I would imagine that I shouldn't have to enter the new folder name since this should see the new folder as a root, correct? Any suggestions? (This content is the same content as the htaccess file in the root folder.)
Try with the below code:
RewriteRule ^/location/(.*)$ /location/usa/$1 [R]
you can refer to the link below:
Hope this helps.
Sorry, it didn't work - unless I put the code in the wrong htaccess file? I put it in the one in the new folder - not the root folder. I would prefer to not touch the root htaccess file, if possible, since it's working just fine for their current site. This folder is just temporary while I build them a new site. The URL's come out as domain/newfolder/equipment/category - which is what we want, but I just get a white screen, the page doesn't load.
Try adding the path to the new folder in rewrite destination.
Sorry, that didn't work either - I didn't think it would since the htaccess file is already IN the newfolder - so the path would not include a subdirectory. But thank you for taking the time to review and offering a suggestion. I have tried putting the /newfolder/ on both sides of the mod-rewrite as well with no success. I currently have the new site setup using the ugly URL's by duplicating the php includes and putting them in the new folder with the new site, I can reference them and we can review the site. When I move the pages to the root folder, they will include the current php include navigation files and the URLs should stay as they are now.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread