如何在我的所有网站网址栏中附加字符串示例(#center)

时间:2019-02-09 14:40:36

标签: php string .htaccess append

我想在我的所有网站URL栏中附加一个字符串示例(#center)

例如我想改变

  • mysite.com
  • mysite.com/folder
  • anythinginurl.com/it.php

    • mysite.com#center
  • mysite.com/folder#center
  • anythinginurl.com/it.php#center

我复制了修改的

RewriteRule ^/?(.*) http://example.com/$1?#center [L,R,NE]

<IfModule mod_rewrite.c>
    RewriteEngine On

    RewriteCond %{QUERY_STRING} !(^|&)#center(&|$) [NC]
    RewriteRule ^ %{REQUEST_URI}?#center [L,QSA,R]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond $1 !^(index\.php|public|images|robots\.txt|css)
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

    But it do not work 
    Can these be achieved using php .htaccess?
   Big thanks for your time

0 个答案:

没有答案