Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/289.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 mod rewrite.htaccess文件godaddy.com问题_Php - Fatal编程技术网

PHP mod rewrite.htaccess文件godaddy.com问题

PHP mod rewrite.htaccess文件godaddy.com问题,php,Php,我是PHP新手,我试图学习mod rewrite来重写我的URL我使用godaddy作为我的托管公司,他们说要将所需的代码添加到你的.htaccess文件中,我如何mod rewrite我的URL并将其添加到我的.htaccess文件中 有没有人能给我举个例子,告诉我如何修改我的URL,并给我一本很好的教程或书 不过需要注意的是,goDaddy通常需要RewriteBase/ 快,脏 RewriteEngine On RewriteBase / RewriteRule ^/?about/?$ a

我是PHP新手,我试图学习mod rewrite来重写我的URL我使用godaddy作为我的托管公司,他们说要将所需的代码添加到你的.htaccess文件中,我如何mod rewrite我的URL并将其添加到我的.htaccess文件中

有没有人能给我举个例子,告诉我如何修改我的URL,并给我一本很好的教程或书

不过需要注意的是,goDaddy通常需要
RewriteBase/

快,脏

RewriteEngine On
RewriteBase /
RewriteRule ^/?about/?$ about.php [L,NC,QSA] # domain.com/about is sent to the server as domain.com/about.php
RewriteRule ^/products/([0-9]+)$ /products.php?id=$1 [L,NC,QSA]  # domain.com/products/23 is sent to the server as domain.com/products.php?id=23 

我是否必须为每个文件夹和子文件夹执行此操作?仅当您需要特定于它们的规则时。。e、 g.文件夹/secretArea可能有自己的htaccess文件,谁知道呢。通常,你会在网站的根目录中找到它们。你对goDaddy的评论要求
RewriteBase/
,这让我省去了很多麻烦。