I have tried a ton of solutions posted at stackoverflow but nothing seems to work for me. I would like to rewrite a few URLs on my site to be search engine friendly.
I would like a URL like this:-
http://www.mysite.com/index.php?filter=accounts
To display as:-
http://www.mysite.com/accounts
A lot of posts around the web give this as the solution:-
RewriteRule ^([^/]+)/?$ index.php?filter=$1 [QSA,L]
But this doesn't do anything.
My site is a Joomla CMS site and there are already some rewrites within the .htaccess file. Could it be that I am putting my new RewriteRule is the wrong place?
Here is the full .htaccess file without my new RewriteRule added
Options +FollowSymLinks
RewriteEngine On
# prevents people from accessing anything with phpMyAdmin
RewriteRule phpMyAdmin - [F]
# force canonical www if request is for non-www or has port number etc
RewriteCond %{HTTP_HOST} !^(www.mysite.com)?$
RewriteRule (.*) http://www.mysite.com/$1 [R=301,L]
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
RewriteCond %{QUERY_STRING} base64_encode[^(]*([^)]*) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F]
RewriteBase /
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/[^.]*|.(php|html?|feed|pdf|raw))$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L]
Any help would be much appreciated.
:-)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…