AdRock Posted September 4, 2006 Share Posted September 4, 2006 Can you rewrite a rule so you get something like[url=http://www.mysite.com/somepage/1]www.mysite.com/somepage/1[/url]from this[url=http://www.mysite.com/index.php?page=something_1]www.mysite.com/index.php?page=something_1[/url]I have about four pages named something_1, something_2 etc and don't know if i need a rewrite rule for each pageI was thinking of something like[code]RewriteRule ^somepage/([0-9]+)/?$ index.php?page=something_$1[/code]but i don't know if this is right Link to comment https://forums.phpfreaks.com/topic/19707-is-this-rewrite-rule-possible/ Share on other sites More sharing options...
oldmanice Posted September 4, 2006 Share Posted September 4, 2006 I think the reason you are getting ? and = is because you have either left gaps in your files or you need to make a vhost. If you have no gaps in your files that could fix the url. Link to comment https://forums.phpfreaks.com/topic/19707-is-this-rewrite-rule-possible/#findComment-85996 Share on other sites More sharing options...
AdRock Posted September 4, 2006 Author Share Posted September 4, 2006 This is my current .htaccess file[code]Options +FollowSymLinksRewriteEngine onRewriteBase /RewriteRule ^([A-Za-z0-9\-_]+)/?$ index.php?page=$1RewriteRule ^gallery/([A-Za-z0-9\-_]+)/([0-9]+)/?$ index.php?page=$1&id=$2RewriteRule ^([A-Za-z0-9]+)/([0-9\-_]+)/?$ index.php?page=$1&pagenum=$2RewriteRule ^admin/([A-Za-z0-9\-_]+)/?$ admin/index.php?page=$1 [L] [/code]which works fine. I can change index.php?page= to just the pagename Link to comment https://forums.phpfreaks.com/topic/19707-is-this-rewrite-rule-possible/#findComment-86004 Share on other sites More sharing options...
oldmanice Posted September 4, 2006 Share Posted September 4, 2006 Um sorry I have know idea Link to comment https://forums.phpfreaks.com/topic/19707-is-this-rewrite-rule-possible/#findComment-86010 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.