Ticket #2381 (new enhancement)
HTACCESS improvement
| Reported by: | T3hDuk | Owned by: | aoneil |
|---|---|---|---|
| Priority: | medium | Milestone: | |
| Component: | (Unknown) | Version: | 2.2.2-rc2 |
| Severity: | medium effort / impact | Keywords: | |
| Cc: | Hours: |
Description
This will redirect http://mysite.com/contact_us --> http://mysite.com/contact_us/ (For SEO puposes) However it requires the user to rewrite the "mysite" in the space below. Maybe someone with another mod_rewrite trick can improve a bit more. (That or give me a bit and I may figure it out)
### SILVERSTRIPE START ### RewriteEngine? On
RewriteCond? %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$ RewriteCond? %{REQUEST_URI} !/$ # Redirect to add a trailing slash RewriteRule? (.*) http://a1scubagear.com/SilverStripe/$1/ [R=301,L]
RewriteCond? %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$ RewriteCond? %{REQUEST_URI} (.*)$ RewriteCond? %{REQUEST_FILENAME} !-f RewriteRule? .* sapphire/main.php?url=%1&%{QUERY_STRING} [L] ### SILVERSTRIPE END ###
