开发者

Shorten url in expressionengine

I use the cms expressionegine. I want to shorten my url

from http://sionvalais.com/live/sionvalais to http://sionvalais.com/sionvalais

'sionvalais' is the weblog name in EE live is the subdirectory in which EE is installed. Would someone be so kind as to help me 开发者_StackOverflowwith this?


RewriteEngine on

RewriteBase /

# rewrites http://sionvalais.com/sionvalais/* to expression engine
# respectively http://sionvalais.com/live/sionvalais/index.php*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond $1 !\/live*
RewriteRule ^sionvalais/?(.*)$ live/sionvalais/index.php?$1 [L]

# rewrites http://sionvalais.com/live/sionvalais* to http://sionvalais.com/sionvalais*
# and sets http status code 301, so search engines 'forget' about your live directory
RewriteCond $1 !\/index\.php*
RewriteRule ^live/sionvalais(.*)$ /sionvalais$1 [L,R=301]


Here's something to try in your .htaccess file:

  RewriteEngine on
  RewriteCond $1 !^live
  RewriteRule ^sionvalais(.*)$ live/sionvalais$1

It may need more refinement, but it seems to work in a very basic sandbox.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜