user7625487
user7625487

Reputation:

.htaccess Rewrite Rule Error

I am having error in the files. This is my .htaccess file. Redirecting error is mainly that it is showing a 404 error when I click login button then it redirects me to mydomain.com/login which shows me a 404 error as in the file ...

Options +FollowSymLinks -MultiViews
ErrorDocument 404 /warning/notfound
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteRule ^login$ login.php
</IfModule>
Options -Indexes   
IndexIgnore *

Upvotes: 0

Views: 874

Answers (2)

user7625487
user7625487

Reputation:

Okay Now I have the answer actually there should be a slash here ..

RewriteRule ^login$ /login.php

This just solved my problem ...

Upvotes: 0

Olivier Pons
Olivier Pons

Reputation: 15778

Your question is not clear (to the least!) but here's the "translation" of your .htaccess file:

  • ErrorDocument 404 /warning/notfound if there's a 404 then redirect to /warning/notfound

  • RewriteCond %{REQUEST_FILENAME} !-d if the requested URL is not a directory then try to apply the next rule

  • RewriteRule ^(.*)/$ /$1 [L,R=301] Whatever is in the URL, if it ends with a / then remove it and stop URL rewriting rules (L = stop)
  • RewriteRule ^login$ login.php if the URL is login then redirect to login.php

Maybe the L is the source of your problem? I hope I gave you enough clues to solve your problem!

Upvotes: 1

Related Questions