Mod Rewrite not working on my addon domain
I have a Wordpress website on my main domain. For the Wordpress website, I have this in my .htaccess
file:
# BEGIN WordPress
开发者_开发知识库<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
</IfModule>
# END WordPress
I just created an addon domain and wanted to use new rules for it. I created a .htaccess
file and put it inside the addon folder, eg. /newaddon
.
In the .htaccess
file I have:
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^readjob/(.*)/(.*)/(.*)/$ readjob.php?id=$1&cat=$2&title=$3
</IfModule>
The URL stucture I have is this:
http://www.website.com/readjob/3/jobs/web-designers-potech-integrated-services/
But it keeps telling me that the link is broken. I don't know what to do, please I need assistance. I just learnt mod rewriting today, so clarity will be highly appreciated.
I believe this is what your looking for:
Options -Multiviews
I use this in my root directory of domains hosted under my main domain and in my case they happen to be two levels deep.
i.e.
Options +FollowSymlinks
Options -Multiviews
RewriteEngine on
RewriteBase /
to clarify you add Options -Multiviews to the addon websites htaccess file. :D
This is not HTML where the &
should be represented with a character reference (except if used as a reference open delimiter). So:
RewriteRule ^readjob/(.*)/(.*)/(.*)/$ readjob.php?id=$1&cat=$2&title=$3
Furthermore, you should use a more specific pattern than .*
like [^/]+
:
RewriteRule ^readjob/([^/]+)/([^/]+)/([^/]+)/$ readjob.php?id=$1&cat=$2&title=$3
精彩评论