I’ve had trouble with this the last couple of days, looking up tutorials and other peoples examples (including a lot from this site) but I just cannot get it to work.
currently my .htaccess file looks like this:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301]
RewriteRule ^forside/([0-9]+)$ index.php?main=forside
I need to change domain.dk/index.php?main=forside
to domain.dk/forside.
and domain.dk/index.php?main=article&id=10
to domain.dk/article/10
I’ve looked in my phpinfo() and cannot seem to find any information on if the server supports mod_rewrite or not, but the www to non-www redirect works perfectly, so that’s where I’m kinda lost.
If anyone has an idea on what is going wrong or how I could fix this it would be greatly appreciated.
You have two different patterns for forside and articles, so you should have two different rules.
If you want to condense them to one, you could use the following (untested). However, this is not as strict as the above.