Sign in
Google - Webmaster Central

Help forum Feed Feed

Help forum > Webmaster Central > Crawling, indexing & ranking > i have renamed a couple of urls on my site..about 40,000 because of a mispelling. how do i update my .htaccess file

i have renamed a couple of urls on my site..about 40,000 because of a mispelling. how do i update my .htaccess file Report abuse

mjh2000
Level 1
12/6/09
I have read the FAQs and checked for similar issues: YES
My site's URL is: pickaride.com
Description (including timeline of any changes made):
I have changed about 40,000 urls on my site because of mispelling.
i had the word helicoper versus helicopter.
is there a way i can update my .htaccess file to redirect search engines to the new url ?
Update:
thanks - Echwa for your quick response..but that does not seem to work for me.
I have characters and path stuff before and after the word "helicoper" ...would this make a difference ?

I have tried this....
RewriteEngine on
RewriteRule ^helicoper/$ /helicopter/$1

and added 301 redirect...but no luck ..does anyone else have an answer??
i am using joomla with sh404sef ...but i am accessing the sef url and not the non-sef url. 12/8/09

Replies 1 - 17 of 17

Echwa
Level 1
12/7/09
Maybe this in your htaccess:

RewriteEngine on
RewriteRule ^helicoper/$ /helicopter/$1
Did you find this answer helpful? Sign in to vote. Report abuse
landandhouse4sale
Level 1
12/30/09
this did not work..can you tell me why ?
Did you find this answer helpful? Sign in to vote. Report abuse
landandhouse4sale
Level 1
12/30/09
i have urls like http://xxx.com/aaa-helicoper-ssss.html and http://xxx.com/helicoper-sdsdsd_dssfsd.html and http://xxx.com/xxx-ssss_asfsd_helicoper.html
Did you find this answer helpful? Sign in to vote. Report abuse
landandhouse4sale
Level 1
12/30/09
with this entry :
http://www.pickaride.com/alplaus-new_york-prom-helicoper_services.html

i get this reply:
http://www.pickaride.com/index.php?format=html?format=html

and have updated this RewriteRule ^helicoper/$ /helicopter/$1  in my .htaccess file.
Did you find this answer helpful? Sign in to vote. Report abuse
Autocrat
Top Contributor
Webmaster Help Bionic Poster
12/30/09
Okay - bear with and I'll see what I can come up with.
Did you find this answer helpful? Sign in to vote. Report abuse
Autocrat
Top Contributor
Webmaster Help Bionic Poster
12/30/09
RewriteCond %{REQUEST_URI} /.*helicoper.*$ [NC]
RewriteRule ^(.*)helicoper(.*)$ /$1helicopter$2 [R=301,L]
1 of 1 people found this answer helpful. Did you? Sign in to vote. Report abuse
Autocrat
Top Contributor
Webmaster Help Bionic Poster
12/30/09
The above should correct the spelling msitake - no matter where it appears;
Should work if it says    helicoper   in the filename, filepath (directories) etc.
Even if you have
   /helicoper/helicoper/helicoper.txt
:D
Did you find this answer helpful? Sign in to vote. Report abuse
Autocrat
Top Contributor
Webmaster Help Bionic Poster
12/30/09
Related Topic;

how can i use .htaccess to redirect a misspelled word in a url ??
http://www.google.com/support/forum/p/Webmasters/thread?tid=64e39477e4d59d45&hl=en&fid=64e39477e4d59d4500047bf160a956c3
Did you find this answer helpful? Sign in to vote. Report abuse
Phil Payne
Top Contributor
Webmaster Help Bionic Poster
12/30/09
> .. the spelling msitake ...
Did you find this answer helpful? Sign in to vote. Report abuse
Autocrat
Top Contributor
Webmaster Help Bionic Poster
12/30/09
LOL - I'm not saying anything .... not with my typing/spelling ;)
Did you find this answer helpful? Sign in to vote. Report abuse
landandhouse4sale
Level 1
12/31/09
Edit My bad--- i moved your statements higher in the .htaccess file and it worked...do you think these will cause issues based on the .htaccess below ??

RewriteEngine On

RewriteCond %{REQUEST_URI} /.*helicoper.*$ [NC]
RewriteRule ^(.*)helicoper(.*)$ /$1helicopter$2 [R=301,L]

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits

#  Uncomment following line if your webserver's URL
#  is not directly related to physical file paths.
#  Update Your Joomla! Directory (just / for root)

# RewriteBase /


########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section


        # gtranslate config
        RewriteRule ^([a-z]{2})/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA]
        RewriteRule ^([a-z]{2})$ /gtranslate/translate.php?lang=$1 [L,QSA]
        RewriteRule ^(zh-CN)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA]
        RewriteRule ^(zh-CN)$ /gtranslate/translate.php?lang=$1 [L,QSA]
        RewriteRule ^(zh-TW)/(.*)$ /gtranslate/translate.php?lang=$1&url=$2 [L,QSA]
        RewriteRule ^(zh-TW)$ /gtranslate/translate.php?lang=$1 [L,QSA]


# RewriteRule ^helicoper/(.*)   /helicopter/$1   [R=301,L]
# RewriteRule ^helicoper(.*)$ helicopter$1 [R=301,L]
# RewriteRule ^helicoper/$ /helicopter/$1

# RewriteCond %{REQUEST_URI} /.*helicoper.*$ [NC]

# RewriteRule ^(.*)helicoper(.*)$ /$1helicopter$2 [R=301,L]


redirect 301 /trip/vid/1 http://www.pickaride.com
redirect 301 /trip/vid/2 http://www.pickaride.com
redirect 301 /trip/vid/3 http://www.pickaride.com
Did you find this answer helpful? Sign in to vote. Report abuse
Autocrat
Top Contributor
Webmaster Help Bionic Poster
12/31/09
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php

From various tests and attempts - it seems that bit above should appear After all other Redirects?
(It seems if you attempt redirects after that code, they tend not to work).


Would have helped if you had mentioned having other redirects/rewrites in the first place as well (then I could have mentioned it).

.

Still - at least now it all works :D
All you have to do is Wait for Google to recrawl/request the incorrect URLs and get the redirects.
Just make sure there is a correct URL to go to.
Did you find this answer helpful? Sign in to vote. Report abuse
landandhouse4sale
Level 1
1/12/10
Autocrat - i noticed that google has duped a lot of my urls...index2.php and index.php  but having a problem implementing it..can you take a look at my .htaccess string - please?

dupped url:
http://www.xxxx.com/index2.php?option=com_limos&lang=en&purpose=anniversary&state=texas&task=info

real url:
http://www.xxxx.com/index.php?option=com_limos&lang=en&purpose=anniversary&state=texas&task=info

I tried this: (had issues with this)
RewriteRule ^index2/$ /index/$1

So i was thinking of this:
RewriteRule ^index2.php?option=com_limos&lang/$ /index.php?option=com_limos&lang/$1

but not working.
Did you find this answer helpful? Sign in to vote. Report abuse
Autocrat
Top Contributor
Webmaster Help Bionic Poster
1/12/10
[Edit: My bad - prior post was incorrect (used & instead of ? - not a true Query based URL]
[Edit: prior post had bad URL in it ... so removed and pre-pended to this post :D]


If there is no index2.php - you could try this...

RedirectMatch 301 ^/index2.php$ http://sub.domainname.tld/index.php$1


Or we have this....


RewriteCond %{QUERY_STRING} ^option=com_limos$
RewriteRule ^index2\.php$ http://sub.domainname.tld/index.php?option=com_limos [R=301,L]

You may need to alter it a bit....

RewriteCond %{QUERY_STRING} ^option=com_limos&lang=en&purpose=anniversary&state=texas&task=info$
RewriteRule ^index2\.php$ http://sub.domainname.tld/index.php?option=com_limos&lang=en&purpose=anniversary&state=texas&task=info [R=301,L]


I've managed to get both of those to work (or atleast, similar parameters).
So should work.
Did you find this answer helpful? Sign in to vote. Report abuse
landandhouse4sale
Level 1
1/12/10
Thanks Autocrat - i am confused about the updates that went on in this discussion.
Just to recap:

Google - indexes my index2.php with params - causing a lot of duplicate content, so i tried:
i tried this:
RedirectMatch 301 ^/index2.php$ http://sub.domainname.tld/index.php$1

and this :

RewriteCond %{QUERY_STRING} ^option=com_limos$
RewriteRule ^index2\.php$ http://sub.domainname.tld/index.php?option=com_limos [R=301,L]

and this:

RewriteCond %{QUERY_STRING} ^option=com_limos&lang=en&purpose=anniversary&state=texas&task=info$
RewriteRule ^index2\.php$ http://sub.domainname.tld/index.php?option=com_limos&lang=en&purpose=anniversary&state=texas&task=info [R=301,L]


Of course i pluged into it my website name, but this caused havac on my server - joomla apparently needs that file.

so now i am testing putting it into my robots.txt file:

Disallow: /index2.php$

i guess i will know in a few days if google stops displaying this in the search, yes?
Did you find this answer helpful? Sign in to vote. Report abuse
Autocrat
Top Contributor
Webmaster Help Bionic Poster
1/13/10
?

Now I have no idea.

Why would Joomla need a second index file?
Or are you running two sets of dyanmic systems, 1 through index.php, the other through index2.php?


If you have the same content appearing under 2 URLs,
and the only difference is index.php // index2.php - this suggests that the same info/data is being passed through and returned - so 1 of those files is technically redundant/not needed.


+

Are you saying you have Multiple different URLs/Pages being indexed with   index2.php  in the URL ?
(Not just the one you mentioned)

Did you find this answer helpful? Sign in to vote. Report abuse
landandhouse4sale
Level 1
1/13/10
i am not a programmer..so i honestly do not know any of the answers to your quesiton - it is a joomla thing.
But I do however know that I am using sh404sef which is a component that makes friendly urls.
I think this in conjunction with .htaccess mod_rewrite does the friendly urls.
I will try the robots.txt and see what happens..i think that is safe and hopefully google respects it.

thanks
again mjh
Did you find this answer helpful? Sign in to vote. Report abuse

Post reply

This discussion is closed to new replies.

Subscribe

Subscribe to the Feed feed for this discussion

Go to:

Tell us how we're doing: Please answer a few questions about your experience to help us improve our Help Center.