magnetica2 Posted September 3, 2011 Share Posted September 3, 2011 Hi Im trying to redirect an old search page which was domain.co.uk/?q=search but now it's domain.co.uk/search?q=search. I have the code below but nothing happens. I'm pretty sure that this is close to right but i'm not an expert with the htaccess file so any advice would be appreciated. I do use CodeIgniter but I don't believe that would affect the code. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^\?q=(.*)$ RewriteRule ^\?q=(.*)/$ search?q=$1 [R=301,L] Also just so you know I am using the code below to remove trailing slashes and that works fine. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^(.*)/$ RewriteRule ^(.*)/$ $1 [R=301,L] Link to comment https://forums.phpfreaks.com/topic/246370-htaccess-doesnt-redirect-need-advice/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.