Quantcast
Channel: WarpConduit Computing » htaccess
Viewing all articles
Browse latest Browse all 4

RewriteRule and Trailing Slashes

$
0
0

Just a quick post today, i needed to redirect a URL with and without a trailing slash to the same destination, but didn’t want to create two separate rules, so I did some searching and found that it is very simple.

RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^video(/)?$ http://video.somedomain.com [R=301,L]

The (/)? is the key to matching a url with or without a trailing slash.


Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles



Latest Images