Jump to content

How do I add a new redirect to .htaccess?


Simon Culshaw

Recommended Posts

Posted

Hello, my .htacess file looks like this today:-

<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule \.(js|css|jpeg|jpg|gif|png|ico)(\?|$) - [L,NC,R=404]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

I need to redirect users from https://www.example.com/services/scripts/<scriptname>-r<recordid> to https://www.example.com/scripts/<scriptname>-r<recordid> 

AND

I need to redirect users from https://www.example.com/services/scripts/_/<category>/<scriptname>-r<recordid> to https://www.example.com/scripts/<scriptname>-r<recordid> 

The latter has an _ (underscore) in the URL

Where abouts in the file would I add these rules? I'm assuming the order is important!

Many Thanks in advance fro your help

Posted

Shouldn't matter as long as you put them on their own lines. If you're getting errors there's possibly some sort of conflict at play that you may need to account for differently.

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...