简体   繁体   English

我如何像 facebook 一样缩短我的 url 到用户个人资料页面

[英]How do i shorten my url like facebook do to users profile page

I am trying to shorten my website url of a newly added page event like我正在尝试缩短新添加的页面事件的网站网址,例如

mysite.com/asoebi/myevent instead of mysite.com/asoebi/index.php?event=myevent mysite.com/asoebi/myevent而不是mysite.com/asoebi/index.php?event=myevent

but every time i try to change my .htaccess file it give an error但每次我尝试更改我的 .htaccess 文件时,它都会出错

在此处输入图片说明

here is .htaccess code这是 .htaccess 代码

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^index/(\w+)$ ./index.php?event=$1

</IfModule>

您必须在 apache 中启用 mod_rewrite 才能使其工作。

Put this one in the .htaccess file in the /public_html/asoebi/ folder将此放在/public_html/asoebi/文件夹中的.htaccess文件中

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /asoebi/
RewriteRule ^(.*)$ index.php?event=$1 [L]

</IfModule>

Also remove the last rewriterule from the main htaccess file you posted above同时从上面发布的主 htaccess 文件中删除最后一个重写器

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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