![]() | | ||||||||
| | #1 |
| Active Warrior Join Date: Sep 2009
Posts: 81
Thanks: 62
Thanked 9 Times in 7 Posts
|
Hi guys, I'm really having a problem with this htacess file - i'm not geat, and am trying to put it together with code on the web. I'm trying to make the following happen: Code: http://site.com redirect to http://www.site.com http://www.site.com/folder redirect to http://www.site.com/folder/ AND put it all together as a rewrite redirect to the index... http://www.site.com/page-name/ redirect to http://www.site.com/index.php?p=page-name So a www is always added. A forward slash is always added. and anything after the domain is actually poinint to index as a variable. Can anyone help? Thanks so much! |
| | |
| | #2 |
| Advanced Warrior War Room Member Join Date: May 2004 Location: Perth, Australia.
Posts: 717
Thanks: 4
Thanked 182 Times in 138 Posts
|
Question 1 : http://site.com redirect to http://www.site.com Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^site\.com RewriteRule ^(.*)$ http://www.site.com/$1 [R=permanent,L] Question 2 : http://www.site.com/folder redirect to http://www.site.com/folder/ RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$ http://www.site.com/$1/ [L,R=301] Final part : RewriteRule ^(.*)/$ http://www.site.com/index.php?p=$1 [L,R=301] Hope this helps Bruce |
| ----------------- Get Your Backlinks indexed quicker at BackLinks2RSS Create Full Text Feeds from Partial RSS Feeds at FeedExpander.com. See the WarriorForum post about it here | |
| | |
| | #3 |
| Active Warrior Join Date: Sep 2009
Posts: 81
Thanks: 62
Thanked 9 Times in 7 Posts
|
Perfect mate! Thanks so much. |
| | |
![]() |
|
| Tags |
| hard, htacess, question |
| Thread Tools | |
| |
![]() |