?301 buy-dogs.aspx?type=tibetan-mastiff HOW?
8 posts
• Page 1 of 1
?301 buy-dogs.aspx?type=tibetan-mastiff HOW?
good morning, trying to do a 301 permanent redirect from
site.com/buy-dogs.aspx?type=tibetan-mastiff TO site.com/tibetan-mastiff
people clicking site.com/buy-dogs.aspx?type=tibetan-mastiff
should see site.com/tibetan-mastiff in their url bar
with content from site.com/buy-dogs.aspx?type=tibetan-mastiff
since there's only 4 urls, a mapfile.txt won't be necessary
admin, i've tried some examples from this forum but each of them was slightly different from my implementation, so 1:1 copies never worked. i'm out of examples, so could you please help?
site.com/buy-dogs.aspx?type=tibetan-mastiff TO site.com/tibetan-mastiff
people clicking site.com/buy-dogs.aspx?type=tibetan-mastiff
should see site.com/tibetan-mastiff in their url bar
with content from site.com/buy-dogs.aspx?type=tibetan-mastiff
since there's only 4 urls, a mapfile.txt won't be necessary
admin, i've tried some examples from this forum but each of them was slightly different from my implementation, so 1:1 copies never worked. i'm out of examples, so could you please help?
- suntattood
- Posts: 27
- Joined: 04 Dec 2012, 21:06
Re: ?301 buy-dogs.aspx?type=tibetan-mastiff HOW?
Irrelevant!!!
Re: ?301 buy-dogs.aspx?type=tibetan-mastiff HOW?
go tie your father's shoes if you have nothing better to do
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: ?301 buy-dogs.aspx?type=tibetan-mastiff HOW?
Hello,
Try using the following:
but if you want a universal rule, try:
Regards
Andrew
Try using the following:
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond %{QUERY_STRING} ^type=tibetan-mastiff$ [NC]
RewriteRule ^buy-dogs\.aspx$ /tibetan-mastiff? [NC,R=301,L]
RewriteRule ^tibetan-mastiff$ /buy-dogs.aspx?type=tibetan-mastiff [NC,L]
but if you want a universal rule, try:
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond %{QUERY_STRING} ^type=([^&]+)$ [NC]
RewriteRule ^buy-dogs\.aspx$ /%1? [NC,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ /buy-dogs.aspx?type=$1 [NC,L]
Regards
Andrew
Re: ?301 buy-dogs.aspx?type=tibetan-mastiff HOW?
HeliconAndrew wrote:Hello,
Try using the following:
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond %{QUERY_STRING} ^type=tibetan-mastiff$ [NC]
RewriteRule ^buy-dogs\.aspx$ /tibetan-mastiff? [NC,R=301,L]
RewriteRule ^tibetan-mastiff$ /buy-dogs.aspx?type=tibetan-mastiff [NC,L]
but if you want a universal rule, try:
- Code: Select all
RewriteEngine on
RewriteBase /
RewriteCond %{QUERY_STRING} ^type=([^&]+)$ [NC]
RewriteRule ^buy-dogs\.aspx$ /%1? [NC,R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)$ /buy-dogs.aspx?type=$1 [NC,L]
Regards
Andrew
andrew, thank you,
both appear to work!! however, there is now an
The page isn't redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
error in firefox. ie just seems to load something and then stop (page won't change)
what could be causing this? looking at http headers in firefox, it appears the 301 goes on and on several times (no page changes in browser) and then halts (upon which i'm shown that error)
please help one more time,
let's hope the children in tibet can be warm soon!!
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: ?301 buy-dogs.aspx?type=tibetan-mastiff HOW?
It's a redirect loop. Which means there's another rule that takes part in it... or there's smh else on your side.
Regards
Andrew
Regards
Andrew
Re: ?301 buy-dogs.aspx?type=tibetan-mastiff HOW?
andrew, i've narrowed down what seems to happen--
RewriteCond %{QUERY_STRING} ^type=tibetan-mastiff$ [NC]
RewriteRule ^buy-dogs\.aspx$ /tibetan-mastiff? [NC,R=301,L]
RewriteRule ^tibetan-mastiff$ /buy-dogs.aspx?type=tibetan-mastiff [NC,L]
with this one, site.com/buy-dogs.aspx?type=tibetan-mastiff
redirects to site.com/tibetan-mastiff
AND THEN IMMEDIATELY RE-REDIRECTS TO site.com/buy-dogs.aspx?type=tibetan-mastiff
the loop seems to come into existence because the longurl redirects to the shorturl without "stopping" to load the content. they just keep redirecting into eachother
i've tried removing the last line and only going with
RewriteCond %{QUERY_STRING} ^type=tibetan-mastiff$ [NC]
RewriteRule ^buy-dogs\.aspx$ /tibetan-mastiff? [NC,R=301,L]
however, in this case it attempts to look for... a physical directory named /tibetan-mastiff, which obviously doesn't exist on the ftp. the result is a 404 (not found) error
do you have any advice?
RewriteCond %{QUERY_STRING} ^type=tibetan-mastiff$ [NC]
RewriteRule ^buy-dogs\.aspx$ /tibetan-mastiff? [NC,R=301,L]
RewriteRule ^tibetan-mastiff$ /buy-dogs.aspx?type=tibetan-mastiff [NC,L]
with this one, site.com/buy-dogs.aspx?type=tibetan-mastiff
redirects to site.com/tibetan-mastiff
AND THEN IMMEDIATELY RE-REDIRECTS TO site.com/buy-dogs.aspx?type=tibetan-mastiff
the loop seems to come into existence because the longurl redirects to the shorturl without "stopping" to load the content. they just keep redirecting into eachother
i've tried removing the last line and only going with
RewriteCond %{QUERY_STRING} ^type=tibetan-mastiff$ [NC]
RewriteRule ^buy-dogs\.aspx$ /tibetan-mastiff? [NC,R=301,L]
however, in this case it attempts to look for... a physical directory named /tibetan-mastiff, which obviously doesn't exist on the ftp. the result is a 404 (not found) error
do you have any advice?
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: ?301 buy-dogs.aspx?type=tibetan-mastiff HOW?
This is very strange, because only one rule has redirect flag - R=301. Please, double check the rules and make sure you use it only i one of the config files.
Regards
Andrew
Regards
Andrew
8 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 4 guests