Jump to content

URL rewrite Question


neilfurry

Recommended Posts

Can somebody help me with this:

 

i have 2 URL's that needs to be rewritten using RewriteRule on my .htaccess, this are the two URL:

 

http://mysite.com/index.php?page=commerce&college

http://mysite.com/index.php?page=about

 

can you help me write a RewriteCond for this URL's on a .htaccess.

 

Regards.

 

 

Link to comment
https://forums.phpfreaks.com/topic/136299-url-rewrite-question/
Share on other sites

currently i have this :

 

RewriteRule ^(.*)\.html$ index.php?college&page=$1 [NC], this works fine,

 

that when i click on a link with mypage.html it will give the page of http://mysite.com/index.php?page=cas&college,

 

but i need another condition for this URL:

 

http://mysite.com/index.php?page=about

 

i have used the following script but it doesn't work:

 

RewriteRule ^(.*)\.html$ index.php?college&page=$1 [NC]

RewriteRule ^(.*)\.html$ index.php?page=$1 [NC]

 

 

Regards.

 

Thanks in advance

 

 

Link to comment
https://forums.phpfreaks.com/topic/136299-url-rewrite-question/#findComment-711084
Share on other sites

just to be clear this is the scenario:

 

mypage.html goes with ----->  RewriteRule ^(.*)\.html$ index.php?college&page=$1 [NC] which has the variable college in the URL

 

 

then,

 

mypage2.html ------> goes with RewriteRule ^(.*)\.html$ index.php?page=$1 [NC]  which does not have the college variable in the URL

 

i need just the RewriteCond for this,

 

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/136299-url-rewrite-question/#findComment-711119
Share on other sites

This are different all i need is just a condition for this two

 

RewriteRule ^(.*)\.html$ index.php?college&page=$1 [NC]

RewriteRule ^(.*)\.html$ index.php?page=$1 [NC]

that doesnt make sense i guess because it will match the first and the last condition  so it will always be the first.. correct me if i was wrong any way..  pre explain mo nag maiigi tapos add mo ko sa YM teng84 pre i think you need to add specific rule on each condition
Link to comment
https://forums.phpfreaks.com/topic/136299-url-rewrite-question/#findComment-711123
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.