Reputation: 1119
Why does the following htaccess file generate 300 errors, when this URL is called?
URL: hxxp://subdomain.domainame.com/keyworda/
IndexIgnore *
RewriteEngine on
RewriteRule ^([a-z]+)/$ /index.php?p=$1
Error log: 300 hxxp://subdomain.domainame.com/keyworda (no trailing slash)
Upvotes: 1
Views: 280
Reputation: 1327
Edit, I was trying to keep my answer short, I didn't mean for you to add this line exactly. It was just to show where the missing slash should go.
RewriteRule ^/([a-z]+)/$ /index.php?p=
I'm assuming you are editing a .conf file, in your apache config directory. Chigley's answer is assuming you are editing a per-directory .htaccess config file.
Edit your conf file to look like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_METHOD} ^TRACE
RewriteRule .* - [F]
RewriteRule ^/(test[a-z]+)/$ /index.php?id=$1 [L,R=301]
... your current stuff afterwords ...
</IfModule>
Once it's working, this is the real RewriteRule to use in your conf file:
RewriteRule ^/([a-z]+)/$ /index.php?id=$1 [L,R=301]
If it does not work, edit your question to include the full code in the block, and your httpd version, like this:
# httpd -v
Server version: Apache/1.3.33 (Darwin)
Server built: Mar 20 2005 15:08:27
Probably doesn't matter, but just incase...
Here is the mod_write documentation. There are some examples at the very bottom.
Upvotes: 1
Reputation: 12785
can you try this one:
RewriteRule ^([^/]+)/?$ /index.php?p=$1
Upvotes: 0