PDA

View Full Version : What am I missing?



ozgression
03-11-2006, 09:10 PM
Ok, so I have the following in my htaccess:


Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)/?$ index.php?page=$1 [QSA,L]

Now, that works great for site.com/page , but doesnt work for site.com/page/ <-- note the trailing slash.

What I want to do is have a trailing slash and if you type the url without the trailing slash you are forced to the trailing slash version (make sense?).

I am aware that there is a modrewrite article on this site but this sort of stuff makes no sense to me and I assume (hope) that this something simple that a good coder knows how to fix, simply. :)

Any help is appreciated.

MarkB
03-12-2006, 02:04 AM
RewriteRule ^(.*)/?$ /page/$1/ [R]
RewriteRule ^(.*)/?$/ index.php?page=$1 [QSA,L]


I *think* that might work? (redirects URLs without trailing slash to one with trailing slash, and then looks up the correct index.php based record)

ozgression
03-17-2006, 06:41 PM
Hmm... tried that and it didnt work.

Thanks, though. :)