I have moved to phpBB(all files) forum root to sub folder name /forum/.
Want to redirect
Force www
domain.tld -> /news/ (wordpress)
domain.tld/press/ -> /news/
domain.tld/site/ -> /news/
domain.tld/phpbb.php files -> /forum/
With limited understanding of htaccess .. i tried few copy/paste from web.. unfortunately non worked!.
- Code: Select all
Options +FollowSymlinks
Options -Indexes
RewriteEngine on
# RewriteCond %{HTTP_HOST} !^www.domain.tld$ [NC]
# RewriteRule ^(.*)$ http://www.domain.tld/$1 [R=301]
# RewriteCond %{HTTP_HOST} !^www\.domain\.tld [NC]
# RewriteRule (.*) http://www.domain.tld/$1 [R=301]
# RewriteCond %{HTTP_HOST} ^(www.)?domain.tld$ [NC]
# RewriteCond %{HTTP_HOST} ^(www.)?domain.tld$ [NC]
# RewriteCond %{REQUEST_URI} ^/index.php [OR]
# RewriteRule ^(.*)$ /news/$1 [R=301]
RewriteRule ^$ http://www.domain.tld/news/ [L,R=301]
RewriteCond %{HTTP_HOST} ^(www.)?domain.tld$ [NC]
RewriteCond %{REQUEST_URI} ^/faq.php [OR]
RewriteCond %{REQUEST_URI} ^/feed.php [OR]
RewriteCond %{REQUEST_URI} ^/mcp.php [OR]
RewriteCond %{REQUEST_URI} ^/memberlist.php [OR]
RewriteCond %{REQUEST_URI} ^/posting.php [OR]
RewriteCond %{REQUEST_URI} ^/report.php [OR]
RewriteCond %{REQUEST_URI} ^/search.php [OR]
RewriteCond %{REQUEST_URI} ^/ucp.php [OR]
RewriteCond %{REQUEST_URI} ^/viewforum.php [OR]
RewriteCond %{REQUEST_URI} ^/viewonline.php [OR]
RewriteCond %{REQUEST_URI} ^/viewtopic.php [OR]
RewriteCond %{REQUEST_URI} ^/download/ [OR]
RewriteCond %{REQUEST_URI} ^/images/ [OR]
RewriteCond %{REQUEST_URI} ^/js/ [OR]
RewriteCond %{REQUEST_URI} ^/styles/ [OR]
RewriteRule ^(.*)$ /forum/$1 [R=301]
RewriteRule /site/?(.*) http://www.domain.tld/news/$1 [R=301]
RewriteRule /press/?(.*) http://www.domain.tld/news/$1 [R=301]
#php_value memory_limit 128M
#ServerSignature Off
<FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh|bak|old)$">
Order Allow,Deny
Deny from all
</FilesMatch>
Thanks.

English |
French