Help needed for 301 redirect using htaccess

Started on the old forum in September 2011 · view the original in the archive · old links redirect here

#301 #htaccess #new-domain #redirect

3 replies · 349 views · started 15 years ago · 1 min read

2 participants
phpnoob Junior · 14 posts #1

I want to redirect all pages in my old domain to my new domain

i used the below code for redirecting all pages in the old domain

Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

but this redirecting is not working correctly when any page names contain a space ..how can i fix this ?

any1 pls help out ...

phpnoob Junior · 14 posts #3

atef wrote: try this

Redirect 301 / http://Yournewdomainname.com/

thanks a lot buddy ,...that fixed my space problem... now can i ask one more doubt regarding folders ... I just want to keep my index there and redirect and redirect all other pages.. Is that possible with this redirect ??

atef Developer · 224 posts #4

delete/rename all ur site contets or move them at a secret folder and use this

ErrorDocument 400 http://yournewdomainname.com
ErrorDocument 401 http://yournewdomainname.com
ErrorDocument 403 http://yournewdomainname.com
ErrorDocument 404 http://yournewdomainname.com
ErrorDocument 500 http://yournewdomainname.com

if u done that all will redirect expect index and that secret folder

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close