4WebHelp
 FAQ  •  Search  •  User Groups  •  Forum Admins  •  Smilies List  •  Statistics  •  Rules   •  Login   •  Register
Toggle Navigation Menu

 mod_rewrite again....
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic
Author Message
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Fri Nov 14, 2003 4:29 pm (20 years, 5 months ago) Reply with QuoteBack to Top

I'm trying to replace this:
/directory1/directory2/index.php?chapter=introduction
with
/directory1/directory2/introduction or /directory1/directory2/introduction/

so far I have this, but its throwing out an internal server error
Code:
Options +FollowSymLinks
RewriteEngine on

RewriteCond %{REQUEST_URI} ^/directory1/directory2/([a-z]*)
RewriteRule ^(.*) /directory1/directory2/index.php?chapter=%1 [L]



I don't get it because this does an identical thing but with numbers and works fine. They are in different directories so are not clashing with each other in some way.
Code:
Options +FollowSymLinks
RewriteEngine on

RewriteCond %{REQUEST_URI} ^/directorya/directoryb/([0-9]*)/([0-9]*)
RewriteRule ^(.*) /directorya/directoryb/review.php?c=%1&p=%2 [L]


what am I missing?
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
adam
Forum Moderator & Developer



Joined: 26 Jul 2002
Posts: 704
Location: UK

PostPosted: Fri Nov 14, 2003 4:53 pm (20 years, 5 months ago) Reply with QuoteBack to Top

shouldn't it be chapter=$1 not %1?

other than that I'm not sure

________________________________
It's turtles all the way down...
OfflineView User's ProfileFind all posts by adamSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Fri Nov 14, 2003 5:13 pm (20 years, 5 months ago) Reply with QuoteBack to Top

Also do you have any way of looking at the server logs?

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Fri Nov 14, 2003 5:14 pm (20 years, 5 months ago) Reply with QuoteBack to Top

Now I just get a 404 Sad
If I stick .html on the end then that works perfectly, but I'd rather have it the other way.
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Fri Nov 14, 2003 5:17 pm (20 years, 5 months ago) Reply with QuoteBack to Top

Theres fair number of these from my IP
Request exceeded the limit of 20 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Daniel
Team Member



Joined: 06 Jan 2002
Posts: 2564

PostPosted: Fri Nov 14, 2003 5:26 pm (20 years, 5 months ago) Reply with QuoteBack to Top

Oh here's the problem: you're catching everything, including directory2/index.php, and redirecting it to directory2/index.php. So you're going round in circles. (At least that's what I'm guessing Very Happy)

I think you'll have to put index.php somewhere else...

________________________________
Image
OfflineView User's ProfileFind all posts by DanielSend Personal Message
Darren
Team Member



Joined: 05 Feb 2002
Posts: 549
Location: London

PostPosted: Fri Nov 14, 2003 6:24 pm (20 years, 5 months ago) Reply with QuoteBack to Top

Just to let everyone know how this was eventually resolved (with Daniel's help Very Happy ), I decided to abandon the directory and am using the following:

http://www.mydomain.com/directory1/directory2/introduction.chapter
Code:
Options +FollowSymLinks
RewriteEngine on

RewriteCond %{REQUEST_URI} ^/directory1/directory2/([a-z]*).chapter
RewriteRule ^(.*) /directory1/directory2/index.php?chapter=%1 [L]


Although it will work, with something like this (but I wasn't keen on that Smile )

http://www.mydomain.com/directory1/directory2/c_introduction/
Code:
Options +FollowSymLinks
RewriteEngine on

RewriteCond %{REQUEST_URI} ^/directory1/directory2/c_([a-z]*)
RewriteRule ^(.*) /directory1/directory2/index.php?chapter=%1 [L]
OfflineView User's ProfileFind all posts by DarrenSend Personal MessageVisit Poster's Website
Display posts from previous:      
Post New TopicReply to Topic
View Previous Topic Print this topic View Next Topic


 Jump to:   




You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot edit your posts in this forum.
You cannot delete your posts in this forum.
You cannot vote in polls in this forum.


Page generation time: 0.304658 seconds :: 18 queries executed :: All Times are GMT
Powered by phpBB 2.0 © 2001, 2002 phpBB Group :: Based on an FI Theme