Mod Rewrite Problems…
-
Hello,
I have modified my WordPress theme so that I can use query strings to insert static content from files onto my WordPress blog using the PHP include(); function.
For example, https://domain.com/index.php?content=contact would insert the the contents of the file called contact.php into the sidebar of my wordpress blog.
I am trying to use mod-rewrite to tidy up my URLs, so that https://domain.com/content/contact/ will redirect to https://domain.com/index.php?content=contact
I have enabled permalinks on WordPress and this is the code that is presently in my .htaaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>In order to make my non-wordpress mod-rewrite function to work, I have pasted the mod-rewrite code needed above the wordpress generated code:
RewriteEngine On
RewriteRule ^content/([^/]*)/$ /index.php?content=$1 [L]<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>However, this does not seem to work. When I navigate to the URL: https://domain.com/content/contact/, instead of seeing my contact data included on the page, I see the 404 error file that is apart of my wordpress theme.
For some unknown reason, it looks as if I cannot get my mod-rewrite function and the wordpress mod-rewrite function to work together.
I would be grateful if anyone could tell me if I an doing anything wrong – and if so, is there any way I could fix things ?
Thank you all in advance ??
EDIT:
Wordpress: version 2.0.1
Apache: 1.3.33
PHP: 4.3.11I am not running any WordPress plugins, apart from Askimet.
- The topic ‘Mod Rewrite Problems…’ is closed to new replies.