Reputation: 31
Kindly help me out with ReWriteRule... My question is that i have a link that i have to make clean and even made it, but when i apply same ReWriteRule for the other link the data dont display.. For Example:
Link 1 : localhost:8080/domain/index.php?subj=about_us For this i wrote this rule.. RewriteRule ^(.*).html/?$ index.php?subj=$1 [NC,L]
Link 2 : localhost:8080/domain/brands_content.php?brand=about_brand For this i wrote this rule.. RewriteRule ^(.*).html/?$ brands_content.php?brand=$1 [NC,L]
First link rule is perfect and i am getting the clean links, but for the second link the rule is not working, page loaded but no content....
Waiting for ur kind responce....
Upvotes: 2
Views: 317
Reputation: 121
(answer revised a second time as per our exchange in the comments)
First, don't use the L flag, because you're telling Apache that this is the "last" rule, and it will stop processing.
Second, it is still a bit difficult for me to understand your goal here. Until/unless you can describe your actual goal better, I'm afraid I can't help. Here are a few options, perhaps you can pick one?
Option one:
You want users to click a navigation link with src of "index.php?subj=about_us", and have them go to that page, but have the URL bar say "about_us.html".
Option two:
You want users to click a navigation link with src of "index.php?subj=about_us", and have them go to the actual page "about_us.html", but still say "index.php?subj=about_us" in the URL bar.
Option three:
You want users to click a navigation link with src of "about_us.html", but have them go to the actual page "index.php?subj=about_us" AND see "index.php?subj=about_us" in the URL bar.
Option four:
You want users to click a navigation link with src of "index.php?subj=about_us", but have them go to the actual page "about_us.html" AND see "about_us.html" in the URL bar.
If you can tell me which of these is closest to your goal, I'll make one more attempt to help you. :)
Upvotes: 1