Jump to content

Need some help for conditional rewrite


cooldude832

Recommended Posts

I am trying to revert all my sites php pages like so

http://www.mysite.com/pages/page5.php

to

http://www.mysite.com/index.php?page=pages/.page5.php

 

I wrote

Options +FollowSymLinks
Options +Indexes 
RewriteEngine On

RewriteBase /
RewriteCond {REQUEST_URI} !=index.php
RewriteRule ^(.+)\.php$ index.php?id=$1 [R]    

but it makes an infinite loop any ideas?

 

doing this

Options +FollowSymLinks
Options +Indexes 
RewriteEngine On

RewriteBase /
RewriteCond {REQUEST_URI} !=index.php
RewriteRule ^(.+)\.php$ index.php?id=$1 [R,L]    

gives me the incorrect $1 (its always index)

Link to comment
https://forums.phpfreaks.com/topic/110845-need-some-help-for-conditional-rewrite/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.