Jump to content

Mod rewrite - trailing slash "/" question


umairmasood

Recommended Posts

Hello,

 

Here is what my .htaccess contains:

 

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^.* list.php

 

Now this is the code which is using the keyword "How-I-Met-Your-Mother" in the url http://www.dontwatchvideo.com/How-I-Met-Your-Mother/ to show the relevant videos based on the keyword. It is being done by sending the keyword "How-I-Met-Your-Mother" to a .php page (using $_Get) on my site to process the videos for this keyword.

 

But if I goto http://www.dontwatchvideo.com/How-I-Met-Your-Mother the page shows no videos. No keyword is passed to the $_Get paramater if the trailing slash "/" is not added to the end of the url.

 

Please tell me how to edit the line

RewriteRule ^.* list.php

so that it works without trailing slash "/"

 

Please let me know.

 

Thnx

Link to comment
Share on other sites

  • 2 weeks later...

I am not sure if there is a better solution but on my server I write another rule with the slash at the end, it works to add it in same rule by writing (/)? at the end, I think it is like this for your rule:

 

RewriteRule ^.*(/)?$ list.php

 

Unless others have better ideas

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.