Welcome to Geeklog, Anonymous Sunday, March 15 2026 @ 10:57 am EDT
Geeklog Forums
Playing with rewrite
Status: offline
alb3rt
Forum User
Regular Poster
Registered: 10/30/06
Posts: 71
Location:Mexico City
Hi boys,
I try to implement rewrite for topics (independent) via .htaccess, with this rules:
URL REAL URL
~/sectionA -> /real_topicA
~/sectionA/topicX -> /real_topicX
~/sectionA/topicX/article1 -> /article1
The idea is:
If exist article1 redirect to the article
else if exist topicX redirect to topicX
else if exit sectionA redict to topicA
I try this:
RewriteRule ^topicX/articleX /article.php?story=articleX [L]
But always applied the first rule, always redirect to /index.php?topic=topicX
Any idea how to implement this?
D Web Studio - www.d-webstudio.net
I try to implement rewrite for topics (independent) via .htaccess, with this rules:
Text Formatted Code
URL REAL URL
~/sectionA -> /real_topicA
~/sectionA/topicX -> /real_topicX
~/sectionA/topicX/article1 -> /article1
The idea is:
If exist article1 redirect to the article
else if exist topicX redirect to topicX
else if exit sectionA redict to topicA
I try this:
Text Formatted Code
RewriteRule ^topicX /index.php?topic=topicX[L]RewriteRule ^topicX/articleX /article.php?story=articleX [L]
But always applied the first rule, always redirect to /index.php?topic=topicX
Any idea how to implement this?
D Web Studio - www.d-webstudio.net
19
19
Quote
Status: offline
::Ben
Forum User
Full Member
Registered: 01/14/05
Posts: 1581
Hello,
According to the apache documentation
Read more here
::Ben
According to the apache documentation
The definition order of these rules is important, because this order is used when applying the rules at run-time.
Read more here
::Ben
16
16
Quote
Status: offline
alb3rt
Forum User
Regular Poster
Registered: 10/30/06
Posts: 71
Location:Mexico City
Hi Ben,
You're right, it works.
Thanks.
D Web Studio - www.d-webstudio.net
You're right, it works.
Thanks.
Quote by: cordiste
Read more here
::Ben
Hello,
According to the apache documentation
The definition order of these rules is important, because this order is used when applying the rules at run-time.
Read more here
::Ben
D Web Studio - www.d-webstudio.net
20
26
Quote
All times are EDT. The time is now 10:57 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content