0
votes

I have a wordpress installation inside a subdirectory called "wordpresss"

Inside that directory i have a .htaccess file

I am trying to rewrite a file inside the root of the wordpress directory like this

http://mysite.com/wordpress/facebook.php?i=135

into

http://mysite.com/wordpress/facebook/135.html

This is what i have so far and i cant seem to work out what is wrong...

RewriteEngine on
RewriteBase /wordpress/
RewriteRule ^facebook/([0-9]+)\.html$ facebook.php?i=$2

Thanks for any help!!

1
What did you do, what happened and what did you expect to happen?Gumbo
My expectation is that when i call the url i can view the page the same way as mysite.com/wordpress/facebook.php?i=135 but while typing mysite.com/wordpress/facebook/135.html. For the moment i only get the 404 errer - file not foundTobias
To debug this you could add the [R] option to the end of RewriteRule. This will redirect the browser to the rewritten URL so you can easily see what Apache tries to load as a result of that rule.vehnae

1 Answers

1
votes

The variables prepended by a dollar sign in a RewriteRule uses info from the parts between brackets. Since you only have one of those ( ([0-9]+) ) you only have one variable to work with. Change the $2 to $1 and see if that works.