View Full Version : MOD_Rewrite
07-04-2004, 07:02 AM
IF have this link
links to xxx dot com are not permitted
I need to get this to something like
Can you please help
07-04-2004, 07:03 AM
This link posted above are generted dynamically.
You might wanna give an example of the dynamic url, and the static url you desire.
07-16-2004, 02:09 AM
I would want
RewriteRule (.*).php /page.php?cat=$1
This will work as long as you don't have folders named the same as your category or, if you have 2 categories the same.
If you wanted it failsafe try:
RewriteRule (.*)/(.*).php /page.php?id=$1&cat=$2
07-17-2004, 03:24 PM
Better is to disguise altogether the php extension. The exact code would depend on to what extent you want to failsafe the characters used in category; if we assume, for discussion, that category must be entirely numeric, then you could use:
RewriteRule ^([0-9]+)\.html$ /category.php?id=1&cat=$1 [L]
That would rewrite a call of the form:
to a call to--
A necessary assumption here is that you have no actual files in your root directory whose names are just some numerals followed by .html.
If category can be more complex than just numerals, then the term shown above as [0-9]+ would need to be a "regular expression" denoting the possible form. (For another example, if category were limited to capital letters and numerals, that term would be [0-9A-Z]+).
07-19-2004, 12:11 AM
wow look at all the mod rewrite discussion that can be transfered to http://www.mod-rewrite.com/forum/ :)
vBulletin v3.0.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.