User Tools

Site Tools


permalinks

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
permalinks [2012/02/15 02:04]
ccagle8
permalinks [2013/03/27 12:31]
Timbow removed
Line 23: Line 23:
 <​code>?​id=%slug%</​code>​ <​code>?​id=%slug%</​code>​
  
-===== Adding .php or .html to URLs =====+===== Adding .html, .htm or .php extension ​to URLs =====
  
-If you want to add either ​''​.php''​ or ''​.html''​ to your website'​s pages, you first need to set the **Custom Permalink Structure** to ''​%slug%.php''​.+If you want to add an extension (''​.html'',​ ''​.htm''​ or ''​.php''​to your website'​s pages, you first need turn on **Use Fancy URLs**, then set the **Custom Permalink Structure** to (example for pages that will end in ''​.html''​): 
 +<​code>​%slug%.html</​code>​
  
 Next, you need to make a small change to your root level ''​.htaccess''​ file. Change the Rewrite Rule to this: Next, you need to make a small change to your root level ''​.htaccess''​ file. Change the Rewrite Rule to this:
-<​code>​RewriteRule /?​([A-Za-z0-9_-]+)\.php$ index.php?​id=$1 [QSA,​L]</​code>​ +<​code>​RewriteRule /?​([A-Za-z0-9_-]+)\.html$ index.php?​id=$1 [QSA,​L]</​code>​ 
-NOTE: Change ''​.php''​ to ''​.html''​ in the Rewrite Rule above if you are using that extension instead.+ 
 +NOTE: Change ''​.html''​ to ''​.php'' ​(or ''​.htm''​) ​in both the Rewrite Rule above and the permalink structure, ​if you are using that extension instead.