Technical Discussion
  >> Web Design / HTML / Web hosting Forum


Register (or login) on our website and you will not see this ad.


These posts have been archived and can no longer be replied to or modified.
  Print Thread
Standard User bigtart
(committed) Sun 04-Apr-10 23:54:19
Print Post

htaccess mod_rewrite help


[link to this post]
 
Can someone fix my code please:


RewriteEngine on
RewriteRule ^/$ http://www.mydomain.co.uk/forum/index.php [R]
RewriteRule ^index\.php$ http://www.mydomain.co.uk/forum/index.php [R]

The first rewriterule doesnt seem to be working. Problem is a lot of people might have bookmarked the site www.mydomain.co.uk/ I cant seem to redirect that at all.
I need to do it this way because I'm putting in a rewritecond so that my ip is not redirected.

Any help much appreciated

Matt

Edited by bigtart (Mon 05-Apr-10 01:06:01)

Standard User deleted
(deleted) Mon 05-Apr-10 09:23:55
Print Post

Re: htaccess mod_rewrite help


[re: bigtart] [link to this post]
 
Try this:
Text
1
23
45
6
Options +FollowSymLinks
RewriteEngine onRewriteCond %{HTTP_HOST} ^yoursite.com
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L]RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^index\.html$ http://www.yoursite.com/ [R=301,L]
  Print Thread

Jump to