Moving forum to folder, root to news

Discussions about Apache mod Rewrite, .htaccess, Use, experiences ... URL Rewriting.

Moderator: Moderators

Moving forum to folder, root to news

Postby z2z » Tue Jan 24, 2012 8:10 am

Hi,

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.
z2z
 
Posts: 2
Joined: Mon Jan 16, 2012 8:36 am

Advertisement

Re: Moving forum to folder, root to news

Postby z2z » Wed Jan 25, 2012 7:38 am

anybody?
z2z
 
Posts: 2
Joined: Mon Jan 16, 2012 8:36 am


Return to Apache mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 2 guests