• Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

htaccess redirect question...

Status
Not open for further replies.
I made a coding mistake and some URLs have been indexed which arnt correct.

sitename.co.uk/whiteproduct/?q=White&page=6&sort=relevance

The "page=6" part is the only bit that changes. But I can add each string individualy to htaccess if easier, as only a few of these pages indexed.

I want the URL to 301 to...

sitename.co.uk/search.php?q=White&page=6&sort=relevance

Please note I cant just tell htaccess to point everything inside whiteproduct folder to go back to index page as there is a content page there...

Thanks

You need something like:

Options +FollowSymlinks
RewriteEngine On
RewriteRule ^whiteproduct/([^/.]+)/?$ /search.php?q=$1 [R,L]

I'll have another look tomorrow if that doesn't work
 
Last edited:
  • Like
Reactions: mat
Glad you got it sorted, mod_rewrite can be a PITA lol and I had just looked at too much code yday to figure it out :P
 
Status
Not open for further replies.
Top Bottom