URL rewriting not working anymore

Status
Not open for further replies.

abcroste

Member
Messages
39
Reaction score
0
Points
6
Hello,

URL rewriting stopped working for my website (I'm on lotus).

Below are the rules in my .htaccess file, in the root of my public folder.
Basically, I want to rewrite URLs such as
http://www.abc-roster.com/contact to http://www.abc-roster.com/index.php?page=contact
for a few pages

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^index$ index.php
RewriteRule ^home$ index.php
RewriteRule ^download$ index.php/?page=download
RewriteRule ^screenshots$ index.php/?page=screenshots
RewriteRule ^contact$ index.php/?page=contact
RewriteRule ^application$ index.php/?page=ref&file=application
RewriteRule ^manual$ index.php/?page=ref&file=manual

</IfModule>

Going to any of the pages throws a 404 page not found error, instead of redirecting the request to the index.php page.

e.g.
http://www.abc-roster.com/contact
http://www.abc-roster.com/home

I'm pretty sure it was working before.

Thanks for your help
 

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
Try getting rid of the forward slashes before the question mark:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^index$ index.php
RewriteRule ^home$ index.php
RewriteRule ^download$ index.php?page=download
RewriteRule ^screenshots$ index.php?page=screenshots
RewriteRule ^contact$ index.php?page=contact
RewriteRule ^application$ index.php?page=ref&file=application
RewriteRule ^manual$ index.php?page=ref&file=manual

</IfModule>
 

lemon-tree

x10 Minion
Community Support
Messages
1,420
Reaction score
46
Points
48
No idea then. You could try it without the <IfModule mod_rewrite.c> wrapper, to see if that is causing the problem, otherwise I can't see anything wrong with the code.
The other alternative is that the .htaccess file is not even being loaded, make sure the permissions are set up correctly.
 

syuffyq

New Member
Messages
4
Reaction score
0
Points
0
Well, Lotus is experiencing issues with Apache setting since 11 pm, June 8th (GMT). I viewed the Apache settings, and the Document_Root value turned out to be wrong. Not sure whether it affects the Mod_Rewrite functions or not. Perhaps it does...
 
Last edited:

abcroste

Member
Messages
39
Reaction score
0
Points
6
No idea then. You could try it without the <IfModule mod_rewrite.c> wrapper, to see if that is causing the problem, otherwise I can't see anything wrong with the code.
The other alternative is that the .htaccess file is not even being loaded, make sure the permissions are set up correctly.

Removing the IfModule did not work either, and permissions are set to 644.
The thing is, it was working last week. Besides, I've got some other code to redirect abc-roster.com to www.abc-roster.com in the .htaccess file, which works. So the file seems to be working correctly except for the url rewriting.

As syuffyq says, it may have something to do with some Apache issues on lotus.

Thank you for your help.
 

Anna

I am just me
Staff member
Messages
11,750
Reaction score
581
Points
113
It is possible lotus has been updated to the new config (as chopin, cossacks and boru has per information at http://status.x10hosting.com)

If that is the case, adding “RewriteRoot /” to .htaccess should do the trick.
 

dlukin

New Member
Messages
427
Reaction score
25
Points
0
If that is the case, adding “RewriteRoot /” to .htaccess should do the trick.

As far as I know, there is no such mod_rewrite directive and it should cause 500 errors.

I believe that the proper directive is RewriteBase /
 

abcroste

Member
Messages
39
Reaction score
0
Points
6
Hmm, I can't even test your suggestion... all my files are gone from my public_html folder. Maybe something to do with my account being moved to use the new cPanel?

Edit: I just manually copied all my files back, nothing works. I probably have to be patient :/
 
Last edited:
Status
Not open for further replies.
Top