Go Back   WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk
Register Blogs FAQ Social Groups CalendarHelp Desk

Reply
 
LinkBack Thread Tools
Old 03-06-2010, 01:49 PM   #1
Active Warrior
 
Join Date: Sep 2009
Posts: 81
Thanks: 62
Thanked 9 Times in 7 Posts
Default Hard .htacess question???

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!
guest is offline   Reply With Quote
Old 03-07-2010, 08:19 AM   #2
Advanced Warrior
War Room Member
 
Bruce Hearder's Avatar
 
Join Date: May 2004
Location: Perth, Australia.
Posts: 717
Thanks: 4
Thanked 182 Times in 138 Posts
Social Networking View Member's Twitter Profile  View Member's YouTube Profile
Contact Info
Send a message via Skype™ to Bruce Hearder
Default Re: Hard .htacess question???

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
Bruce Hearder is offline   Reply With Quote
Old 03-10-2010, 01:01 PM   #3
Active Warrior
 
Join Date: Sep 2009
Posts: 81
Thanks: 62
Thanked 9 Times in 7 Posts
Default Re: Hard .htacess question???

Perfect mate!

Thanks so much.
guest is offline   Reply With Quote
Reply

  WarriorForum - Internet Marketing Forums > Warrior Support Forums > Programming Talk

Tags
hard, htacess, question

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -6. The time now is 02:04 AM.