I always try to keep spaces out. Old browsers can cause a 404 error with those URLs, and new browsers change it to the space character, something like %20 . What kind of script is it?
Just want to add some thing to this FAQ,.. Redirecting the pages ending with a certain extension to another one,.. for example you have pages ending with .html and want to redirect all request's to shtml pages with same url but the extension as shtml.. You can use this code! RedirectMatch (.*)\html$ (.*)\shtml$ It works nice!
hi I need few Urls, to be mod,.. Can you suggest Short urls for these urls,... index.php?page=shownews&newsid=1 index.php?page=allnews index.php?page=stories index.php?page=login index.php?page=privacy index.php?page=terms_of_use index.php?page=faq I will be glad, If the urls look like /shownews1.html or shownews2.html Thanks In advance
Hi, I have a seo question about 301 redirect. I have two domains www.domain.com & www.domain2.com. I would like www.domain2.com to be redirected to www.domian.com/spanish_version. I already have search engine listings for www.domain.com but not the other. The Spanish folder exists too. www.domian2.com is keyword friendly. Firstly, can I use a 301 for this and what syntax do I use in my .htaccess? Secondly, will this be seen as spamming or any other negative search engine problem? Thanks for any help with this Web.
Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^([^.]+)/([^.]+)\.html$ index.php?page=$1&newsid=$2 [L] RewriteRule ^([^.]+)\.html$ index.php?page=$1 [L] Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^([^.]+)$ http://www.domian.com/spanish_version [R=301,L]
Thanks for the Help, It really helped me.. I had a rough Idea and now I can implement it! Im getting for one page 404 I will let you know about it first let me do the above given code thanks!
Great article Nintendo! I can do the 301 direct on an individual page, but when it comes down to doing it on all of the domain I'm having problems. Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteBase / RewriteRule ^whatever/(.*)$ http://www.my-site.com/$1/ [R=301,L] What should go in 'whatever' the index.html or .php or the domain www.mydomain.com? Ta Darren
That example is for domain.com/whatever/(.*) moving to new-site.com/$1/ (.*) and $1 being all files that have the same name at the old and new location. Old URL directory/files go first, then the new one where it shows the full URL. for a complete domain... RewriteRule ^(.*)$ http://www.my-site.com/$1 [R=301,L]
Thanks nintendo. I read the guidelines you have posted here and it worked for me. Thanks for sharing this.
Nintendo, that worked perfectly for the test domains I've been playing with. I have a few questions if that's okay; 1. Will it pass through the PR for www.old-domain.com to the www.new-domain.com? 2. Is it best to ask your link partners to change the domain or will the search engines do that? 3. In your experience in doing a 301 direct, have you lost rankings, and if so how long has this lasted. For example if the domain is new, would it go into the sandbox? I've made a big decision into go and change the domain of my main site, so if you have any other advice it would be appreciated. Darren
I've done it once and the PR was moved. I'm not sure about the other two. Make a thread in the Google board.
Okay will do Nintendo Just one thing I have noticed testing this 301 direct out. I have a domain www.old-domain.com and have asked it to point to www.new-domain.com but if I type in www.old-domain.com/forum it doesnt point to www.new-domain.com - it brings up an error 404 on the old domain. So I'm a little baffled now lol If I wanted to point www.old-domain.com/forum to the new domain would I need a new line in the .htaccess file? The site I am looking to do the domain change for has a couple of hundred PHP and HTML pages.
RewriteRule ^(.*)$ http://www.my-site.com/$1 [R=301,L] Should get the whole domain. Try RewriteRule ^forum/(.*)$ http://www.my-site.com/forum/$1 [R=301,L] and/or RewriteRule ^forum/$ http://www.my-site.com/forum/ [R=301,L] in .htaccess in the main directory. if those don't work, post your current .htaccess code with the domain name changed.
Okay, that makes sense. So do I have to set up the same file structure on the new domain as in the old domain, i.e. have a /forum/ folder. Sorry, if it sounds a dumbarse question lol
It can be different on the new domain. RewriteRule ^forum/(.*)$ http://www.my-site.com/messageboards/$1 [R=301,L] for example. And having a / at the end of both is probably required if you link to it with the / . First part shows the directory info for the current URL, then the new domain and directory info which can be anything.
Thanks Nintendo. That worked great. Are there a limit to how many RewriteRule's you can have in an .htaccess file?
(nintendo is actually the creater of the .htaccess module and will soon use it to control the internet) do not be fooled!!!! send money to SVZ to be saved.
Argh I want to mod rewrite /travel/travel-services.php?travel_service=Insurance to be /travel-shop/Insurance.html Any ideas mod rewrite wacko expert?