Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php .htaccess编译时出错_Php_.htaccess - Fatal编程技术网

Php .htaccess编译时出错

Php .htaccess编译时出错,php,.htaccess,Php,.htaccess,我想使用htaccess创建一个假url。。我已经在寻找所有论坛或教程来编写htaccess,但为什么我在更深的“/”上出错了。。这是我的代码: Options +FollowSymlinks RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php RewriteCond %{SCRIPT_FILENAME} !-

我想使用htaccess创建一个假url。。我已经在寻找所有论坛或教程来编写htaccess,但为什么我在更深的“/”上出错了。。这是我的代码:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

RewriteCond %{SCRIPT_FILENAME} !-d 
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule ^about-us content.php?id=1 [L,NC,QSA]
RewriteRule ^how-to-order content.php?id=2 [L,NC,QSA]
RewriteRule ^information content.php?id=3 [L,NC,QSA]
RewriteRule ^contact-us content.php?id=4 [L,NC,QSA]

RewriteRule ^accessories product.php?category=1 [L,NC,QSA]
RewriteRule ^accessories/([^/]+) product.php?sub-category=$1 [NC]
当我尝试键入“”时。。背面显示“product.php?category=1”是正常的。但为什么当我想访问“”时,它会重定向到“product.php?sub category=kalung”,但没有css。。设计是空白的,变成白色,没有图像或css


请帮助,非常感谢:)

您可能正在为您的资产(图像、css等)使用相对路径,如:

尝试从解析该url时,例如
http://www.beauty4easy.com/accessories/kalung
,它将在以下位置查找资产:

http://www.beauty4easy.com/accessories/images/...
一种可能的解决方案是为您的资产使用绝对路径,如:

/images/some_image.jpg
/css/styles.css

您可能正在使用资产(图像、css等)的相对路径,如:

尝试从解析该url时,例如
http://www.beauty4easy.com/accessories/kalung
,它将在以下位置查找资产:

http://www.beauty4easy.com/accessories/images/...
一种可能的解决方案是为您的资产使用绝对路径,如:

/images/some_image.jpg
/css/styles.css

实际上它仍然是localhost,但是我不能在那里键入localhost,实际上它仍然是localhost,但是我不能在那里键入localhost