Reputation: 1348
i know that this question was already posted a lot of time, i ve already search but i could not find what i need.
i'm working on my htaccess to add seo freindly link, for example:
Options -MultiViews
RewriteBase /
RewriteRule ^list$ list.php [L]
that work perfectly, the problem apper when i try to add vars, for exmpale i need that the url: pages.php?id=terms become: page/terms
so i've try in many way but don't work, this is what i try:
Options +FollowSymLinks
RewriteRule ^list$ list.php [L]
RewriteRule ^page/(.*)/ pages.php?x=$1 [L]
PS: what is the difference between +FollowSymLinks and -MultiViews?
Upvotes: 2
Views: 330
Reputation: 784868
Add QSA
flag:
Options +FollowSymLinks -MultiViews
RewriteRule ^list$ list.php [L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^page/([^/]+)/?$ pages.php?x=$1 [L,QSA,NC]
QSA
(Query String Append) flag preserves existing query parameters while adding a new one.+FollowSymLinks
makes Apache follow symbolic links.-MultiViews
make turns off content negotiationFor CSS/JS/image:
http://
or a slash /
.<base href="/" />
Upvotes: 2