.htacces How To Write Htacces Rewrite Rule For Seo Friendly Url

- 1 answer

I'm just new to .htacces

I want:

changed to:

I google'd some and tried but no change url.



That's not how .htaccess work : it won't change your links to display the corrected version, but it looks for a match in the expressions you'll write into it to rewrite the correct parameters.

For example, in your code, your .htaccess sould look something like this :

RewriteEngine On
RewriteRule ^([a-z-]+)$  page.php?page=$1 [QSA,L]

If you write in your browser, you'll be able to see the content of

I advise you to be VERY careful though : as the expression is VERY permissive, you'll have to check in the page.php file that the file if legitimately allowed to be loaded.