Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

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.

Rule #1: Be Respectful

Do not insult any other member. Be polite and do business. Thank you!

Members online

Premium Members

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom