Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

i want to redirect 301 subdomain to same subdomain but in new folder See what I mean .. http://sub.site.com/(.*) to http://sub.site.com/folder/

but when i go to folder the page not open

Note: the .htaccess put in main subdomain

please help ..

and sorry for my bad english

share|improve this question
    
Do you get any errors (e.g. redirect loop)? –  Jay Jul 7 '12 at 19:23
    
yes redirect loop :( –  ahmed Jul 7 '12 at 20:14

1 Answer 1

up vote 1 down vote accepted

Based on your first comment, try this:

RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/folder/
RewriteRule ^(.*)$ folder/$1 [L,R=301]
share|improve this answer
    
yes works but if i go to links like this subdomain/one.html subdomain/two.html subdomain/three.html etc .. it not work to redirect to new folder ! i want to redirect it in new main page in folder .. like this subdomain/one.html -> subdomain/folder/one.html subdomain/two.html -> subdomain/folder/two.html subdomain/three.html -> subdomain/folder/three.html etc .. and thanks for all .. –  ahmed Jul 7 '12 at 20:27
    
Please experiment with my update. –  Jay Jul 7 '12 at 20:42
    
thanks .. thats work great –  ahmed Jul 7 '12 at 21:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.