简体   繁体   English

我的.htaccess mod_rewrite规则无法正常工作

[英]my .htaccess mod_rewrite rule doesn't work properly

I am trying to set up a site and using the .htaccess file to rewrite all my URL's so that the .php isn't needed. 我试图建立一个站点,并使用.htaccess文件重写我的所有URL,因此不需要.php。

EG www.blahblah.com/file EG www.blahblah.com/file

instead of 代替

www.blahblah.com/file.php www.blahblah.com/file.php

My .htaccess file is currently this: 我的.htaccess文件当前是这样的:

 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> RewriteCond %{HTTP_REFERER} !^http://example.co.uk/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://example.co.uk$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.example.co.uk/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.example.co.uk$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.example.co.uk/match/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.example.co.uk/match$ [NC] RewriteCond %{HTTP_REFERER} !^http://example.co.uk/match/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://example.co.uk/match$ [NC] RewriteRule .*\\.(jpg|jpeg|gif|png|bmp)$ - [F,NC] 

and my site is stored in the directory /match.. 我的网站存储在目录/ match ..

Please some one tell me why my links won't work :( its been bugging me for hours! 请有人告诉我为什么我的链接不起作用:(它困扰了我好几个小时!

Many thanks in advance. 提前谢谢了。

解决了大家抱歉,浪费您的所有时间!

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

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