It is currently Mon Feb 13, 2012 12:06 am

News News of Apache mod Rewrite

Site map of Apache mod Rewrite » Forum : Apache mod Rewrite

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

Moving forum to folder, root to news

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!.


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} ...
Read more : Moving forum to folder, root to news | Views : 209 | Replies : 1


Rewrite Rules for non-www to www redirects to IP address

I have the following in .htaccess in apache2/htdocs

Options +Indexes +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.rightsizesolutions\.co.uk$
RewriteRule ^(.*)$ http://www.rightsizesolutions.co.uk/$1

but when I type -rightsizesolutions.co.uk into a browser it resolves to the servers IP address rather than -http://www.rightsizesolutions.co.uk

What am I doing wrong?
Read more : Rewrite Rules for non-www to www redirects to IP address | Views : 186 | Replies : 6


subdomain style

Hi, how can I write a rewrite rule for a subdomain which is it a style. I explain with one example:

http//sub.domain.com/index.php

to http://www.domain.com/index.php?style=2

No a redirect, a rewrite url.

Thanks
Read more : subdomain style | Views : 313 | Replies : 1


Exclude a directory for redirect

Hey,

I’ve tried every rendition I can think of for 2 straight hours to get my site to redirect all traffic except one directory:
/feed/

I can't get this to work on wordpress. Here is the simple rules that I have:


Code: Select all
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/feed/
RewriteRule ^/(.*)$ https://mydomain.com/$1 [NC,R=301,L]


This forces all traffic to https. What gives? (pulling my hair out)

I'm trying to expose my blog rss feed without a redirect to https.

Thanks,
David
Read more : Exclude a directory for redirect | Views : 359 | Replies : 2


Rewrite rule!! help

Hi!, I'm trying to make patern for url like this naudinga;254d34e674cbcb04cd4100ff331731c7;atlikejas;69%20Danguje; exactly forthe last part of it : "69%20Danguje" how should I do? My variant is:
Code: Select all
([a-zA-Z0-9%-]+)
it doesnt work:/ please help:]
Read more : Rewrite rule!! help | Views : 275 | Replies : 1


 

Login  •  Register


Statistics

Total posts 40475 • Total topics 8395 • Total members 15098