Hej,
I’m trying to achieve a pretty urls for my site with rewrite engine. The goal is this – mysite.dk/da, mysite.dk/da/success and mysite.dk/da#scroll.
So far my htaccess file looks like this:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]
DirectoryIndex /index.php
I tried to implement this
RewriteRule ^da$ da.php [L]
RewriteRule ^da/success$ success.php [L]
but that didn’t really help:/
Thanks
2
Answers
To achieve the pretty URLs you want, modify your
.htaccess
file like this:da
andda/success
at the top so they take precedence.[L]
to stop further rewriting for these specific cases.Have it like this: