Load URL regardless of if a trailing / is present
3 posts
• Page 1 of 1
Load URL regardless of if a trailing / is present
Hello,
Here is my rewrite code:
if you go to this url it loads:
http://uk.mysavings.com/free-samples/Thorntons/2987/
This url does not:
http://uk.mysavings.com/free-samples/Thorntons/2987
would you mind letting me know what I am doing wrong?
Thanks!
Here is my rewrite code:
- Code: Select all
RewriteRule ^free-stuff/[^/]+/(\d+)/$ /link-details.asp?lid=$1 [NC,L,QSA]
if you go to this url it loads:
http://uk.mysavings.com/free-samples/Thorntons/2987/
This url does not:
http://uk.mysavings.com/free-samples/Thorntons/2987
would you mind letting me know what I am doing wrong?
Thanks!
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Load URL regardless of if a trailing / is present
Hello,
In your code you've specified the '/' at the end, to make it optional we need to add '?' after it:
Regards
Andrew
In your code you've specified the '/' at the end, to make it optional we need to add '?' after it:
- Code: Select all
RewriteRule ^free-stuff/[^/]+/(\d+)/?$ /link-details.asp?lid=$1 [NC,L,QSA]
Regards
Andrew
- tidaltides
- Posts: 24
- Joined: 27 Nov 2012, 21:57
Re: Load URL regardless of if a trailing / is present
I lack "?" character almost all the time. This clears everything.
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests