简体   繁体   中英

Rewriting URL:s with .htaccess

Please help me. I spent a lot of time trying to do SEO optimization via a URL link in a .htaccess file but I am unable.

http://www.poplat.com/villa/?option=com_resmania&unit_id=1&isGroup=0&act=Unit&task=details&Itemid=282

The figure should be optimized for SEO, for example:

http://www.poplat.com/villa/apartment/dream/

I tried to do something in the form, but it doesn't work:

## Mod_rewrite in use.
RewriteEngine On
Options +FollowSymlinks

RewriteRule ^villa/([^/]+)/([^/]+)ap1-dream /option=com_resmania&unit_id=$1&isGroup=0&act=Unit&task=details&Itemid=$2 [NC]

I tried this command with no results:

 Options +FollowSymLinks 
    RewriteEngine On 
    RewriteRule ^villa/apartment/dream.html$ villa/?option=com_resmania&unit_id=1&isGroup=0&act=Unit&task=details&Itemid=282 

My site is a CMS using Joomla 2.5.

Make .htacess file as given below and place it in root folder of ur website

This will redirect all pages with ?option=...... to villa/apartment/dream.html

RewriteEngine On

    RewriteRule ^villa/apartment/dream.html$ villa/?option=$1&%{QUERY_STRING}&unit_id=$1&%{QUERY_STRING}&isGroup=$1&%{QUERY_STRING}&act=$1&%{QUERY_STRING}&task=$1&%{QUERY_STRING}&Itemid=$1&%{QUERY_STRING}

And this will redirect only that page you written to villa/apartment/dream.html

RewriteEngine On

    RewriteRule ^villa/apartment/dream.html$ villa/?option=com_resmania&unit_id=1&isGroup=0&act=Unit&task=details&Itemid=282

General Guide

RewriteEngine On

    RewriteRule ^villa/apartment/dream(.*).html$ villa/?option=$1&%{QUERY_STRING}

Take guide from here

Make Sure is turned on in php using function 函数在php中打开

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