J S
J S

Reputation: 41

URL rewriting through .htaccess is not working properly

I have a .htaccess which reads as follows

Options +FollowSymlinks

RewriteEngine On

RewriteBase /

RewriteRule ^([a-z0-9\-]+) /index.php?page_name=$1 [L]

I want the link http://www.solublesilicates.com/our-services when clicked should read as http://www.solublesilicates.com/?page_name=our-services. Please do help.

Upvotes: 1

Views: 55

Answers (3)

user5831063
user5831063

Reputation:

RewriteRule ^([a-z0-9\-]+)$ /index.php?page_name=$1 [L, QSA]

Just change it to the above. Should work perfectly.

Upvotes: 2

Siva
Siva

Reputation: 2785

Change the Rewrite Rule to

RewriteRule ^([A-Za-z0-9\-]+) index.php?page_name=$1 [L,QSA]

Upvotes: 1

Ahmed Khan
Ahmed Khan

Reputation: 516

You have error in your syntax. Your regex should end with $ sign

RewriteRule ^([a-z0-9\-]+)$ /index.php?page_name=$1 [L]

Upvotes: 1

Related Questions