corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » Geek Day » .htaccess RewriteRules


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author .htaccess RewriteRules
MikeLamb
Member

Registered: 23rd Sep 03
Location: Crowthorne Drives: Veccy SRI
User status: Offline
28th Apr 06 at 14:37   View User's Profile U2U Member Reply With Quote

I am using a RewriteRule to give pages on my website this structure:

http://domain.com/x/main/sub/

rather than

http://domain.com/?main=main&sub=sub

and I am using this code in my .htaccess


code:
Options +FollowSymLinks
RewriteEngine on
RewriteRule x/(.*)/(.*)/$ /index.php?main=$1&sub=$2


Which is working fine, but I would like to be able to make it do the following:

http://domain.com/x/main/sub - second paramater has no trailing / (currently returns an error)

&

http://domain.com/x/main/sub/optional/ - having an additional optional field for a tracking ID (for tracking links from emails/adverts,etc)

Anyone have any idea what I need to add to my .htaccess to achieve this?

Cheers!
waynep
Member

Registered: 20th Apr 02
Location: london
User status: Offline
28th Apr 06 at 23:06   View User's Profile U2U Member Reply With Quote

code:

RewriteEngine On
RewriteRule ^main/([^/]*)/sub/([^/]*)\$ /?main=$1&sub=$2 [L]


 
New Topic

New Poll

  Related Threads Author Forum Replies Views Last Post
does anyone know Jodi_the_g Geek Day 2 1017
22nd Dec 04 at 02:26
by Ian
 
web dudes - htaccess Dom Geek Day 2 519
5th Jul 05 at 18:57
by Dom
 
htaccess Melville Geek Day 3 517
14th Dec 05 at 22:17
by Melville
 
Web people Steve Geek Day 8 546
1st Mar 06 at 13:52
by Tim
 
Php.ini Jodi_the_g Geek Day 7 939
17th Apr 06 at 16:14
by Ian
 

Corsa Sport » Message Board » Off Day » Geek Day » .htaccess RewriteRules 28 database queries in 0.0085950 seconds