Guest User

Untitled

a guest
Jul 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. RewriteEngine on
  2.  
  3. # serve / from /site
  4. RewriteCond %{REQUEST_URI} !^/site
  5. RewriteRule ^(.*)$ /site/$1 [L]
  6.  
  7. # remove .php extension
  8. #RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP
  9. #RewriteRule (.*)\.php$ $1 [R=301] ---- broken, adds full path.
  10.  
  11. # remove index
  12. #RewriteRule (.*)/index$ $1/ [R=301]
  13.  
  14. # remove slash if not directory ---- broken, adds full path.
  15. RewriteCond %{REQUEST_FILENAME} !-d
  16. RewriteCond %{REQUEST_URI} /$
  17. RewriteRule (.*)/$ $1 [R=301]
  18.  
  19. # add .php to access file, but don't redirect
  20. RewriteCond %{REQUEST_FILENAME}.php -f
  21. RewriteCond %{REQUEST_URI} !/$
  22. RewriteRule (.*) $1\.php [L]
Add Comment
Please, Sign In to add comment