user2506624
user2506624

Reputation: 75

.htaccess rewrite rule fix query string

I am new to .htaccess and need something very simple, but i cannot seem to get it to work. I have have an .htacces file already and mod_rewrite enabled. I have tried several examples:

#RewriteEngine On
#RewriteCond %{QUERY_STRING} detail/(\d+) [NC]
#RewriteRule ^/detail/$ bestride.com/detail.php?id=%1 [L,R=301]

i have a url like this example.com/detail/23342343243432

i need to rewrite to example.com/detail.php?id=23342343243432

Just for the moment How Do i do this.

Thanks

Upvotes: 0

Views: 916

Answers (1)

Raj Dilip Shah
Raj Dilip Shah

Reputation: 11

Try this:

RewriteEngine On
RewriteBase /
RewriteRule ^(detail)/(.*)$  detail.php?id=$2

Upvotes: 1

Related Questions