User-friendly URL with Boilerplate

Asked

Viewed 91 times

3

I’m using Boilerplate to have a base template for use. But I’m trying to use friendly Urls on it, but I can’t.. I’ve tried several codes, the latest is this:

 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME}\.php -f
 RewriteRule ^(.*)$ $1.php`

Here is the contents of my . htacess http://pastebin.com/JT9gXdG2

But I’m not getting satisfactory results! I just want to remove the . php extension from my links...

1 answer

2


You have activated mod_rewrite. c?

If so. In the site’s folder(root), creates a file called:

.htaccess:

   Options +FollowSymlinks
   RewriteEngine On
   RewriteBase /
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteCond %{REQUEST_FILENAME}.php -f
   RewriteRule ^(.+)$ /$1.php [L,QSA]

Activating the mod_rewrite:

  1. Opens the file httpd.conf, search for mod_rewrite.so and stripping away the # at the beginning of the line.

  2. Look forAllowOverride None and renamed to AllowOverride All.

  • Yes friend, on line 212 of my . htacess has this: <IfModule mod_rewrite.c>&#xA; Options +FollowSymlinks&#xA; # Options +SymLinksIfOwnerMatch&#xA; RewriteEngine On&#xA; # RewriteBase /&#xA;</IfModule>

  • Updated the post. I put how to activate the mod_rewrie.

  • Unfortunately I’m not finding httpd.conf here on the host.. Know some other way around?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.