1

Working on a cPanel server. I need to redirect the domain root for account to a new sub-directory but leave other sub-directories alone, many of which are used as add-on domains for other websites on the same account.

domain1.com uses ./public_html/ and needs to redirect to public_html/newdir

domain2.com uses public_html/subdir

domain2.com is one of many setup this way.

Tried this but it did not work for domain2.com.

RewriteCond %{REQUEST_URI} ^/[/]?$
RewriteRule (.*) /newdir [R=301,L]

Thanks

4

1 に答える 1

0

メインドメインをサブディレクトリではなくブログにリダイレクトしようとしましたが、ルールの下でうまくいきました。

 RewriteEngine on
 RewriteCond %{REQUEST_URI} !^/exclude-directory/.*$
 RewriteRule ^(.*)$ http://redirect-to-domain.name/$1 [R=301,L]

!!!!

于 2014-05-12T21:36:12.407 に答える