Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.