Simple Pretty URLS

lord_spaceman

Expert Member
Joined
Jun 6, 2005
Messages
1,470
Hi guys

Please can you help me out. I'm busy modifying my .htaccess file, but not having any luck (me = n00b)

I have a simple website (eg. http://localhost/test/) with various sections (eg. http://localhost/test/services.php, http://localhost/test/about.php) - basically any sections ends in .php

How do I got about simplifying the URL so it just reads http://localhost/test/services (drops the .php part)

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /test/
RewriteRule ^services test/services.php
</IfModule>
# END WordPress

Thanks
 

mh348

Expert Member
Joined
Jun 2, 2006
Messages
4,211
Hi guys

Please can you help me out. I'm busy modifying my .htaccess file, but not having any luck (me = n00b)

I have a simple website (eg. http://localhost/test/) with various sections (eg. http://localhost/test/services.php, http://localhost/test/about.php) - basically any sections ends in .php

How do I got about simplifying the URL so it just reads http://localhost/test/services (drops the .php part)

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /test/
RewriteRule ^services test/services.php
</IfModule>
# END WordPress

Thanks

Create a separate folder for each eg. test/services and place a index.php in the folder. basically just rename the services.php to index.php but in the new folder 'services'
 

murraybiscuit

Executive Member
Joined
Oct 10, 2008
Messages
6,483
I just saw the code now. If you're doing this for wordpress, you obviously have to be running on apache first and foremost. Then just change your permalink settings to the following: custom structure - /%postname%/%post_id%/
 

Nod

Honorary Master
Joined
Jul 22, 2005
Messages
10,057
Last edited:
Top