cgm225 Posted January 31, 2008 Share Posted January 31, 2008 I have a subdomain site that pulls pages based on an ID variable as such:: wedding.domain.com/index.php5?id=somevalue I want the following to be the rewrites, but I cannot seem to get them to work on the subdomain.. RewriteRule ^home$ /index.php5 RewriteRule ^home/$ /index.php5 RewriteRule ^home/([^/\.]+)$ /index.php5?id=$1 RewriteRule ^home/([^/\.]+)/$ /index.php5?id=$1 Could someone help me with this? Thank you all in advance! bt Quote Link to comment Share on other sites More sharing options...
madmax Posted February 1, 2008 Share Posted February 1, 2008 You've given an example URI but not specified what it's supposed to do. We can't deduce that from your code if you've already said the code doesn't work and doesn't do what it is "supposed" to. If you can supply your intended transformation someone may be able to supply the correct rewrite rule. The only general observations I'd make on the rule code is that the 4 cases could probably be simplified to 2 as far as I can see Also your paths will probably have "/" prepended onto them at some point during rewrite cycles by Apache anyway which will nullify your conditions in ways you didn't anticipate ("home" will become "/home" if in root) Did you intend to append what looks like the path segment after /home/ to the id= part? (I think I read the regex right) You have no "last" flags [L] Enable logging, use tail -f to monitor a test rewrite in real time and you should be able to see what is going wrong. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.