Invision Community 5: A video walkthrough creating a custom theme and homepage By Matt Thursday at 04:02 PM
Simon Culshaw Posted March 11, 2019 Posted March 11, 2019 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
bfarber Posted March 11, 2019 Posted March 11, 2019 https://gist.github.com/ScottPhillips/1721489#file-htaccess-L44 Presumably though, this is a permanent change so you'll want to use a 301 redirect instead of a 302. Note though that if this is to redirect Pages database records, the software may already be able to pick up the change and perform the redirect. You might wish to test first to be sure you even need to do anything custom.
Simon Culshaw Posted March 11, 2019 Author Posted March 11, 2019 @bfarber Thanks for your reply, whereabouts do you put those rules in the .htaccess? They either cause an error 500 OR don’t trigger? Thanks again
bfarber Posted March 11, 2019 Posted March 11, 2019 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.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.