Please help me with 301 redirect..

Discuss practical ways rearrange URLs using mod_rewrite.

Please help me with 301 redirect..

Postby EGS » Tue May 27, 2008 8:17 am

Hello..

I need to do a 301 redirect but it's not working..
I need to redirect http://www.mysite.com/old-page.html to http://www.mysite.com/new-page-structure/

As you can see, I'm redirecting an HTML file to a whole directory, as that's the structure now.

I have to do the files individually..

Can someone please help me? It's not working for me. :(
This is my current code:

Code: Select all
Redirect 301 /sell-mmorpg-accounts-currency.html http://www.egamingsupply.com/mmorpg-market/?$


I had to add the "?$" at the end of the / because it didn't work without it...but now it's ugly and adds the "?$" in the URL. :(

Please help me. :(
EGS
 
Posts: 3
Joined: Tue May 27, 2008 8:14 am

Postby richardk » Wed May 28, 2008 2:33 pm

What's wrong with
Code: Select all
Redirect 301 /sell-mmorpg-accounts-currency.html http://www.egamingsupply.com/mmorpg-market/

?

Try
Code: Select all
Redirect 301 /sell-mmorpg-accounts-currency.html http://www.egamingsupply.com/mmorpg-market/?

or
Code: Select all
RedirectMatch 301 ^/sell-mmorpg-accounts-currency\.html$ http://www.egamingsupply.com/mmorpg-market/

or
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^sell-mmorpg-accounts-currency\.html$ http://www.egamingsupply.com/mmorpg-market/ [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby EGS » Thu May 29, 2008 4:40 am

richardk wrote:What's wrong with
Code: Select all
Redirect 301 /sell-mmorpg-accounts-currency.html http://www.egamingsupply.com/mmorpg-market/

?

Try
Code: Select all
Redirect 301 /sell-mmorpg-accounts-currency.html http://www.egamingsupply.com/mmorpg-market/?

or
Code: Select all
RedirectMatch 301 ^/sell-mmorpg-accounts-currency\.html$ http://www.egamingsupply.com/mmorpg-market/

or
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^sell-mmorpg-accounts-currency\.html$ http://www.egamingsupply.com/mmorpg-market/ [R=301,L]


The first one adds "?page=mmorpg-accounts-currency.html" to end of the URL making a 404 error.. (I think is caused by CMS I am using..and contents already in .htaccess)

The second one adds a "?" to the end of the URL so that it's "/?"..but it does load, not sure if that's SE-friendly though..

Third one also adds "?page-mmorpg-accounts-currency.html" to end of URL making a 404 error..
EGS
 
Posts: 3
Joined: Tue May 27, 2008 8:14 am

Postby EGS » Thu May 29, 2008 3:26 pm

Please help me, as now we are losing rankings.. :(
I really appreciate the help you've been giving me.

This is our .htaccess file (we will remove it once problem is resolved). For some reason we can not have as many 301 redirects as we'd like (as seen below) because we encounter a 500 internal server error, so I had to delete all but the first 3 redirect 301 lines from the .htaccess file to keep my server running...but I'd like to do what is displayed below:

<!--Fixed -->

Can you please help us figure out why the above .htaccess file doesn't work, and why it displays a 500 internal server error instead of functioning?
EGS
 
Posts: 3
Joined: Tue May 27, 2008 8:14 am

Postby richardk » Sun Jun 01, 2008 12:09 pm

You fixed it? What was the problem?

If not, you need to post (or PM it to me) your .htaccess file.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 92 guests

cron