.htaccess tutorial

htaccess Elite


Last slash messes everything up

Ask your mod_rewrite and Redirection questions here, and get answers!

Last slash messes everything up

New postby ChrisBuchholz » 26 Feb 2009 15:23

Hi,

I'm rewriting some urls for my blog and everything's working fine except for if you add a slash behind the url, the relative path - ./, ../ - breaks and stuff like my css files doesn't get included.
If I go to www.domain.com/blog/hehe everything's fine, but www.domain.com/blog/hehe/ breaks.

What I've done is the following:

Code: Select all
RewriteCond %{HTTP_HOST} domain.com
RewriteCond %{REQUEST_URI} !^/blog/wp-admin
RewriteRule ^blog/([a-zA-Z0-9_-]+)(/?)$ blog/single.php?t=$1 [NC]


and as you can see, i try to - (/?) - remove the last slash if it is there, but it doesn't get removed.

How do I get around this?


--
http://www.chrisbuchholz.com/
http://www.chrisbuchholz.com/blog/
ChrisBuchholz
 
Posts: 1
Joined: 26 Feb 2009 15:16

Return to Redirect or Rewrite Questions