简体   繁体   中英

Why does my .htaccess RewriteRule works perfectly on DreamHost but produces Internal Server Error on GoDaddy?

I have this rewrite rule:

RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-//]+)$ index.php?go=$1&extras=$2 [L]  
#/dashboard/test/1/2/3/4 converts to $_GET['go'] = 'dashboard' and $_GET['extras'] = 'test/1/2/3/4'

I had this perfectly working on my DreamHost server but when I transferred my app to my GoDaddy server, it produces a 500 Internal Server Error.

The server on godaddy has probably not got mod_rewrite enabled.

Put this in the .htaccess file and remove everything else:

RewriteEngine On

If mod_rewrite is disabled, you will still get a 500 server error...

try the codes written below in your .htaccess file. I am sure it will work out.



Options FollowSymLinks
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-//]+)$ index.php?go=$1&extras=$2     [L]
#RewriteRule ^([A-Za-z0-9-]+)/([A-Za-z0-9-//]+)$ index.php?go=$1&extras=$2    [PT,L,QSA]

let me know if it worked for you. thanks...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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