简体   繁体   中英

Rewrite a perticular URL in .htaccess file not based on pattern

I want to rewrite a single URL of my website (Joomla) to a friendly URL ie

www.example.com/index.php?option=com_mycomponent&view=article&id=10&nav_button=0&article_layout=1&Itemid=503

to

www.example.com/favourit

without disturbing the other URLs of the website

Thank you for your help.

Original question:

Try

RewriteRule ^favourit$ /index.php?option=com_mycomponent&view=article&id=10&nav_button=0&article_layout=1&Itemid=503 [L]

OP springs a sub folder..

If you intend to move the site live, as example.com presumes your already live but your comment suggests your still working on localhost then you should.

Put in the webroot thats / not /mysite

RewriteRule ^mysite/favourit$ /mysite/index.php?option=com_mycomponent&view=article&id=10&nav_button=0&article_layout=1&Itemid=503 [L]

This is temporary so you don't need to fix once you go live.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM