I'm using Wordpress and have the following pemalink /%category%/%postname%
.
This gives me user friendly URLs like http://www.example.com/something/.
With this permalink, I will not be able to access php files directly, e.g. http://www.example.com/something/myfile.php.
I need to write a ReWrite rule which allows me access to /include/myfile.php. Can some help me please? :)
Here's my current .htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /myblogdirectory/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /myblogdirectory/index.php [L]
</IfModule>
# END WordPress
Update
Ok, I got it working.
I was doing it wrong from the start. I was using the "virtual" path instead of the physical path.
Instead of /mysite/includes/myfile.php, I have to use /wp-content/themes/mytheme/include/myfile.php
I could probably also have added RewriteCond %{REQUEST_URI} !myfile.php, which would have excluded myfile.php from the rewrite rules. I have not tested this though.