z_crow Posted September 2, 2009 Share Posted September 2, 2009 I am having trouble coming up with the .htaccess entries to do the following: the current url looks like this http://www.domainname.com/provincial/bc/filename.php but I want it to look like this: http://www.domainname.com/filename.php Basically, no matter what the filename is, I want the "/provincial/bc/" hidden from the url. Thanks for any help. Link to comment https://forums.phpfreaks.com/topic/172877-htaccess-help/ Share on other sites More sharing options...
cpace1983 Posted September 8, 2009 Share Posted September 8, 2009 With mod_rewrite: RewriteRule http://www.domainname.com/provincial/bc/filename.php http://www.domainname.com/filename.php [R,NC,L] Try that and see if that works. Link to comment https://forums.phpfreaks.com/topic/172877-htaccess-help/#findComment-914443 Share on other sites More sharing options...
Rebelrebellious Posted September 11, 2009 Share Posted September 11, 2009 But add the dynamic part and remove the Redirect flag: RewriteRule http://www.domainname.com/provincial/bc/(.*) http://www.domainname.com/$1 [NC,L] Link to comment https://forums.phpfreaks.com/topic/172877-htaccess-help/#findComment-916865 Share on other sites More sharing options...
z_crow Posted September 11, 2009 Author Share Posted September 11, 2009 Thanks for the responses. I appreciate that. Still can't get it to work though but that might be because of other things in the .htaccess file. Link to comment https://forums.phpfreaks.com/topic/172877-htaccess-help/#findComment-916872 Share on other sites More sharing options...
Rebelrebellious Posted September 11, 2009 Share Posted September 11, 2009 Sorry, I think this may be better: RewriteRule ^/provincial/bc/(.*)$ /$1 [NC,L] or if that doesn't work, try: RewriteRule ^provincial/bc/(.*)$ /$1 [NC,L] I am curious about which solution works. Link to comment https://forums.phpfreaks.com/topic/172877-htaccess-help/#findComment-916874 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.