Jump to content

mods_rewrite and my php pages... help!!!


ukweb

Recommended Posts

Hi

 

I have constructed the following .htaccess file:

 

RewriteEngine on
RewriteRule ^dir/([0-9]+)/?$ /index.php?file=$1 [L]
Options +FollowSymLinks
RewriteCond %{HTTP_HOST} ^colwynbayhonda.com
RewriteRule (.*) http://www.colwynbayhonda.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.colwynbayhonda.com/ [R=301,L]

AddHandler php5-script .php

 

...And MOST of it works lovely! However, my page queries follow the following pattern:

 

mysite.com/index.php?file=<filename>

 

line 2 of the .htaccess is meant to allow the following ruleset:

mysite.com/<filename> would point to mysite.com/index.php?file=<filename>

 

but it dont bloody work!!! any ideas?

 

Thanks in advance

Ste x

 

Link to comment
https://forums.phpfreaks.com/topic/165589-mods_rewrite-and-my-php-pages-help/
Share on other sites

line 2 of the .htaccess is meant to allow the following ruleset:

mysite.com/<filename> would point to mysite.com/index.php?file=<filename>

 

but it dont bloody work!!! any ideas?

 

By line 2 are you refering to this line?

RewriteRule ^dir/([0-9]+)/?$ /index.php?file=$1 [L]

If thats case then your url mysite.com/<filename> wll not work as it is expecting a url like [m]mysite.com/dir/<some number here>[/b]

 

 

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.