【发布时间】:2014-05-15 23:08:17
【问题描述】:
我尝试了几种方法从我的 URL 中删除 index.php。
问题
网址不起作用(我想要这个):http://mysite.in/our-story
网址工作(我不想要这个):http://mysite.in/index.php/our-story
1) 我尝试启用 rewrite_mod 但它已经启用。
2) 我已尝试将此代码写入 .htaccess 文件,但问题未解决。
选项 - 多视图 重写引擎开启
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] </IfModule>
还有剩余的文件安装吗??然后告诉我?? (但我已经安装了所有东西。)
我的 000-default 文件是:
ServerAdmin webmaster@localhost ServerName mydomain.in DocumentRoot /var/www/mysite/public <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/mysite/public/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory>
请给我解决方案。
谢谢朋友!!!
【问题讨论】:
-
将
AllowOverride更改为all而不是none。 -
对,先生......
标签: mod-rewrite ubuntu url-rewriting laravel