Hi, im trying to make this URL:
http://example.com/pages/something.php
TO
http://example.com/something
I get it with this:
RewriteCond %{REQUEST_URI} !^/pages/
RewriteRule ^(.*)$ /pages/$1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php
But i have two errors:
- I cant access to index.php (in root directory)
- When i open any file in pages directory (with the new URL) it loads but the styles, images and everything else doesn’t because, for example: if the style path is …css/main.css it’s requesting …/pages/css/main.css
Any idea? (srry for my bad english)