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
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]

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.