Jump to content
Larry Ullman's Book Forums

Mod_Rewrite Is Not Working With My Urls

Recommended Posts

I am trying to make SEO friendly URLs of using apache mod_rewrite.

My normal URLs is something like this -


My expecting SEO friendly URLs should be something similar to this -


I tried it with creating a .htaccess file and doing some changes to my apache httpd.conf file.

This is my .htaccess file

<ifModule mod_rewrite.c>

# Turn on the engine:
RewriteEngine on

# Set the base to this directory:
RewriteBase /php_advance/ch02/

# Redirect certain paths to index.php:
RewriteRule ^(about|contact|this|that|search)/?$ index.php?p=$1


And also, At the end of the httpd.conf file, I added some code like this -

<Directory "C:/wamp/www/php_advance/ch02">
AllowOverride All

NOTE: I am using WAMP server and Windows 07

But this coding is not working for me. Hope someone will help me out. Thank you.

Link to comment
Share on other sites

Could you please provide some more info into how it's not working? Do you see any errors? What's not working? Where's the index.php file?

As I've mentioned many times before with mod_rewrite scripts, start with something very simple that's easy to confirm the operation of, and then slowly make things more difficult until you get what you want.

  • Upvote 1
Link to comment
Share on other sites


  • Create New...