redirect without id
4 posts
• Page 1 of 1
redirect without id
Hi, I have this re-direct that works fine.
It returns a url like
http://www.mysite.com/gallery/3_name
My question is it possible to remove the number to get just
http://www.mysite.com/gallery/name
Thanks for any help in advance
All the best
Richard
- Code: Select all
RewriteCond %{QUERY_STRING} ^profileid=([^&]+)&galleryname=([^&]+)$
RewriteRule ^gallery\.asp$ gallery/%1_%2? [NC,R=301,L]
#rewrite back to old-URL
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^gallery/([^_]+)_([^_]+)$ /gallery.asp?profileid=$1&galleryname=$2 [NC,L]
It returns a url like
http://www.mysite.com/gallery/3_name
My question is it possible to remove the number to get just
http://www.mysite.com/gallery/name
Thanks for any help in advance
All the best
Richard
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: redirect without id
Hello,
Is the number constant? If it's dynamic, we need to store this parameter in a URL... we may change it to "/gallery/3/name", but that's about it.
Regards
Is the number constant? If it's dynamic, we need to store this parameter in a URL... we may change it to "/gallery/3/name", but that's about it.
Regards
Re: redirect without id
If there's a fixed relationship between name and number, perhaps a mapfile would help?
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 0 guests