My .htacces begins with
RewriteEngine on
RewriteBase /
(I tried it also without RewriteBase…)
I tried all of the following rewriting rules to rewrite the URL
index.php?page=news
to
/blog
- RewriteRule ^/?([-A-Za-z0-9]+)/([-A-Za-z0-9]+)/blog$
index.php?page=$1 [L] - RewriteRule ^([^/]*)/blog$ /sites/blog/index.php?page=$1 [L]
- RewriteRule ([a-zA-z]+)/([a-zA-z]+)/blog$ index.php?page=$1 [L]
Nothing works – no error. Mod_rewrite is installed and working. I restarted Apache and MySQL everytime I changed something in my .htaccess.
I also want to change my URLs which looks like this… index.php?page=single_news&category=release&id=9&headline=Beastie%20Boys%20III
…into: blog/release/9-Beastie-Boys-III
I am lost. Hope you can help me.
Here’s the solution to change links from
http://www.domain.tld/index.php?page=blogtohttp://www.domain.tld/blogis:and for links like:
http://www.domain.tld/index.php?page=single_news&id=1&headline=This%20Is%20A%Headlinethe solution is:
After using this code, links looks like this:
http://www.domain.tld/blog/2-this-is-a-headline