advancedfuture Posted November 10, 2008 Share Posted November 10, 2008 So here's the delimma I am in. I have a dedicated server through server4you. I installed PHP5 and MySQL5 on it. Okay that works no problem. The problem is I have uploaded my .htaccess file to rewrite SEF urls and it doesnt work. My question is this. Is either A.) mod_rewrite disabled somehow on the server and I need to turn it on? If so where. and B.) is my mod_rewrite file messed up? .htaccess file Options +FollowSymLinks RewriteEngine On RewriteRule ^(.*)\.html$ /states.php?&st=$1/ [L] RewriteRule ^(.*)_(.*)\.html$ /city.php?&st=$1&city=$2/ [L] RewriteRule ^(.*)_(.*)_(.*)\.html$ /services.php?&st=$1&city=$2&services=$3/ [L] RewriteBase / Any help for this confusion would be appreciated Quote Link to comment https://forums.phpfreaks.com/topic/132175-dedicated-server-and-htaccess-problem/ Share on other sites More sharing options...
corbin Posted November 10, 2008 Share Posted November 10, 2008 Besides the greedy quantifiers, everything looks fine in your mod rewrite statements, so mod rewrite is probably disabled. If you ssh or what ever into your server and do httpd -t, is mod_rewrite listed as an enabled module? If not (or just check the httpd.conf fild to begin with if that's easier for you [probably is]) uncomment the LoadModule line for mod_rewrite. Quote Link to comment https://forums.phpfreaks.com/topic/132175-dedicated-server-and-htaccess-problem/#findComment-687238 Share on other sites More sharing options...
advancedfuture Posted November 11, 2008 Author Share Posted November 11, 2008 Below is a copy of my httpd.conf file. Now I tried adding "LoadModule rewrite_module modules/mod_rewrite.so" in the file, but when I do and restart apache it tells me that the module is already loaded by default. So I am a bit lost. The directory where my actual files are residing is /usr/local/apache/htdocs Include "/usr/local/apache/conf/includes/pre_main_global.conf" Include "/usr/local/apache/conf/includes/pre_main_2.conf" LoadModule auth_passthrough_module modules/mod_auth_passthrough.so LoadModule bwlimited_module modules/mod_bwlimited.so Include "/usr/local/apache/conf/php.conf" Include "/usr/local/apache/conf/includes/errordocument.conf" KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 15 UseCanonicalName Off AccessFileName .htaccess DefaultType text/plain HostnameLookups Off ErrorLog logs/error_log ServerTokens Full AliasMatch ^/manual(?:/(?:de|en|es|fr|ja|ko|ru))?(/.*)?$ "/usr/local/apache/manual$1" LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv zh-CN zh-TW ForceLanguagePriority Prefer AddType text/html .shtml ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi ScriptAliasMatch ^/?securecpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi ScriptAliasMatch ^/?kpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi ScriptAliasMatch ^/?controlpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi ScriptAliasMatch ^/?securecontrolpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi ScriptAliasMatch ^/?webmail/?$ /usr/local/cpanel/cgi-sys/wredirect.cgi ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi ScriptAliasMatch ^/?securewhm/?$ /usr/local/cpanel/cgi-sys/swhmredirect.cgi Alias /icons/ /usr/local/apache/icons/ Alias /bandwidth/ /usr/local/bandmin/htdocs/ Alias /sys_cpanel/ /usr/local/cpanel/sys_cpanel/ Alias /java-sys/ /usr/local/cpanel/java-sys/ Alias /img-sys/ /usr/local/cpanel/img-sys/ Alias /akopia/ /usr/local/cpanel/3rdparty/interchange/share/akopia/ Alias /neo-images/ /usr/local/cpanel/base/neomail/neo-images/ Alias /mailman/archives/ /usr/local/cpanel/3rdparty/mailman/archives/public/ Alias /pipermail/ /usr/local/cpanel/3rdparty/mailman/archives/public/ Alias /interchange/ /usr/local/cpanel/3rdparty/interchange/share/interchange/ Alias /interchange-5/ /usr/local/cpanel/3rdparty/interchange/share/interchange-5/ ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/" ScriptAlias /cgi-sys/ /usr/local/cpanel/cgi-sys/ ScriptAlias /mailman/ /usr/local/cpanel/3rdparty/mailman/cgi-bin/ ScriptAlias /scgi-bin /usr/local/cpanel/cgi-sys/scgiwrap <IfModule prefork.c> StartServers 5 MinSpareServers 5 MaxSpareServers 10 MaxClients 150 MaxRequestsPerChild 0 </IfModule> <Directory "/"> Options All AllowOverride All </Directory> <Directory "/usr/local/apache/htdocs"> Options Includes Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <Files ~ "^error_log$"> Order allow,deny Deny from all Satisfy All </Files> <FilesMatch "^\.ht"> Order allow,deny Deny from all Satisfy All </FilesMatch> <IfModule mod_mime.c> TypesConfig conf/mime.types AddLanguage ca .ca AddLanguage cs .cz .cs AddLanguage da .dk AddLanguage de .de AddLanguage el .el AddLanguage en .en AddLanguage eo .eo AddLanguage es .es AddLanguage et .et AddLanguage fr .fr AddLanguage he .he AddLanguage hr .hr AddLanguage it .it AddLanguage ja .ja AddLanguage ko .ko AddLanguage ltz .ltz AddLanguage nl .nl AddLanguage nn .nn AddLanguage no .no AddLanguage pl .po AddLanguage pt .pt AddLanguage pt-BR .pt-br AddLanguage ru .ru AddLanguage sv .sv AddLanguage zh-CN .zh-cn AddLanguage zh-TW .zh-tw AddCharset ISO-8859-1 .iso8859-1 .latin1 AddCharset ISO-8859-2 .iso8859-2 .latin2 .cen AddCharset ISO-8859-3 .iso8859-3 .latin3 AddCharset ISO-8859-4 .iso8859-4 .latin4 AddCharset ISO-8859-5 .iso8859-5 .latin5 .cyr .iso-ru AddCharset ISO-8859-6 .iso8859-6 .latin6 .arb AddCharset ISO-8859-7 .iso8859-7 .latin7 .grk AddCharset ISO-8859-8 .iso8859-8 .latin8 .heb AddCharset ISO-8859-9 .iso8859-9 .latin9 .trk AddCharset ISO-2022-JP .iso2022-jp .jis AddCharset ISO-2022-KR .iso2022-kr .kis AddCharset ISO-2022-CN .iso2022-cn .cis AddCharset Big5 .Big5 .big5 AddCharset WINDOWS-1251 .cp-1251 .win-1251 AddCharset CP866 .cp866 AddCharset KOI8-r .koi8-r .koi8-ru AddCharset KOI8-ru .koi8-uk .ua AddCharset ISO-10646-UCS-2 .ucs2 AddCharset ISO-10646-UCS-4 .ucs4 AddCharset UTF-8 .utf8 AddCharset GB2312 .gb2312 .gb AddCharset utf-7 .utf7 AddCharset utf-8 .utf8 AddCharset big5 .big5 .b5 AddCharset EUC-TW .euc-tw AddCharset EUC-JP .euc-jp AddCharset EUC-KR .euc-kr AddCharset shift_jis .sjis AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddHandler type-map var </IfModule> <IfModule mod_log_config.c> LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent CustomLog logs/access_log common </IfModule> <Directory "/usr/local/apache/icons"> Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all </Directory> <Directory "/usr/local/apache/manual"> Options Indexes AllowOverride None Order allow,deny Allow from all SetEnvIf Request_URI ^/manual/(de|en|es|fr|ja|ko|ru)/ prefer-language=$1 RedirectMatch 301 ^/manual(?:/(de|en|es|fr|ja|ko|ru)){2,}(/.*)?$ /manual/$1$2 <Files ~ "^error_log$"> Order allow,deny Deny from all Satisfy All </Files> <Files *.html> SetHandler type-map </Files> </Directory> <Directory "/usr/local/apache/htdocs"> Options Indexes FollowSymLinks MultiViews AllowOverride All <Files ~ "^\.ht"> Satisfy All </Files> </Directory> <Directory "/usr/local/apache/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> <IfModule mod_autoindex.c> IndexOptions FancyIndexing VersionSort AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip AddIconByType (TXT,/icons/text.gif) text/* AddIconByType (IMG,/icons/image2.gif) image/* AddIconByType (SND,/icons/sound2.gif) audio/* AddIconByType (VID,/icons/movie.gif) video/* AddIcon /icons/binary.gif .bin .exe AddIcon /icons/binhex.gif .hqx AddIcon /icons/tar.gif .tar AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip AddIcon /icons/a.gif .ps .ai .eps AddIcon /icons/layout.gif .html .shtml .htm .pdf AddIcon /icons/text.gif .txt AddIcon /icons/c.gif .c AddIcon /icons/p.gif .pl .py AddIcon /icons/f.gif .for AddIcon /icons/dvi.gif .dvi AddIcon /icons/uuencoded.gif .uu AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl AddIcon /icons/tex.gif .tex AddIcon /icons/bomb.gif core AddIcon /icons/back.gif .. AddIcon /icons/hand.right.gif README AddIcon /icons/folder.gif ^^DIRECTORY^^ AddIcon /icons/blank.gif ^^BLANKICON^^ DefaultIcon /icons/unknown.gif ReadmeName README.html HeaderName HEADER.html IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t </IfModule> <IfModule mod_setenvif.c> BrowserMatch "Mozilla/2" nokeepalive BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 BrowserMatch "RealPlayer 4\.0" force-response-1.0 BrowserMatch "Java/1\.0" force-response-1.0 BrowserMatch "JDK/1\.0" force-response-1.0 BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully BrowserMatch "MS FrontPage" redirect-carefully BrowserMatch "^WebDrive" redirect-carefully BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully BrowserMatch "^gnome-vfs" redirect-carefully BrowserMatch "^XML Spy" redirect-carefully BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully </IfModule> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Direct modifications to the Apache configuration file may be lost upon subsequent regeneration of the # # configuration file. To have modifications retained, all modifications must be checked into the # # configuration system by running: # # /usr/local/cpanel/bin/apache_conf_distiller --update # # To see if your changes will be conserved, regenerate the Apache configuration file by running: # # /usr/local/cpanel/bin/build_apache_conf # # and check the configuration file for your alterations. If your changes have been ignored, then they will # # need to be added directly to their respective template files. # # # # It is also possible to add custom directives to the various "Include" files loaded by this httpd.conf # # For detailed instructions on using Include files and the apache_conf_distiller with the new configuration # # system refer to the documentation at: http://www.cpanel.net/support/docs/ea/ea3/customdirectives.html # # # # This configuration file was built from the following templates: # # /var/cpanel/templates/apache2/main.default # # /var/cpanel/templates/apache2/main.local # # /var/cpanel/templates/apache2/vhost.default # # /var/cpanel/templates/apache2/vhost.local # # /var/cpanel/templates/apache2/ssl_vhost.default # # /var/cpanel/templates/apache2/ssl_vhost.local # # # # Templates with the '.local' extension will be preferred over templates with the '.default' extension. # # The only template updated by the apache_conf_distiller is main.default. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # PidFile logs/httpd.pid LockFile logs/accept.lock # Defined in /var/cpanel/cpanel.config: apache_port Listen 0.0.0.0:80 Timeout 300 User nobody Group nobody ExtendedStatus On ServerAdmin info@lm-tek.com ServerName air629.startdedicated.com LogLevel warn ServerSignature On RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect RewriteLock /usr/local/apache/logs/rewrite_lock UserDir public_html # DirectoryIndex is set via the WHM -> Service Configuration -> Apache Setup -> DirectoryIndex Priority DirectoryIndex index.html.var index.htm index.html index.shtml index.xhtml index.wml index.perl index.pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.php4 index.php3 index.php index.phtml default.htm default.html home.htm index.php5 Default.html Default.htm home.html SSLPassPhraseDialog builtin SSLSessionCache dbm:/usr/local/apache/logs/ssl_scache SSLSessionCacheTimeout 300 SSLMutex file:/usr/local/apache/logs/ssl_mutex SSLRandomSeed startup builtin SSLRandomSeed connect builtin <IfDefine SSL> # Defined in /var/cpanel/cpanel.config: apache_ssl_port Listen 0.0.0.0:443 AddType application/x-x509-ca-cert .crt AddType application/x-pkcs7-crl .crl </IfDefine> AddHandler cgi-script .cgi .pl .plx .ppl .perl AddHandler server-parsed .shtml AddType text/html .shtml AddType application/x-tar .tgz AddType text/vnd.wap.wml .wml AddType image/vnd.wap.wbmp .wbmp AddType text/vnd.wap.wmlscript .wmls AddType application/vnd.wap.wmlc .wmlc AddType application/vnd.wap.wmlscriptc .wmlsc <Location /whm-server-status> SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 </Location> # SUEXEC is supported Include "/usr/local/apache/conf/includes/pre_virtualhost_global.conf" Include "/usr/local/apache/conf/includes/pre_virtualhost_2.conf" # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. NameVirtualHost 69.64.38.19:80 NameVirtualHost * # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. <VirtualHost 69.64.38.19:80> ServerName air629.startdedicated.com DocumentRoot /usr/local/apache/htdocs ServerAdmin info@lm-tek.com </VirtualHost> # Default vhost for unbound IPs <VirtualHost *> ServerName air629.startdedicated.com DocumentRoot /usr/local/apache/htdocs ServerAdmin info@lm-tek.com </VirtualHost> # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. <VirtualHost 69.64.38.19:80> ServerName hostlily.com ServerAlias www.hostlily.com DocumentRoot /home/hostlily/public_html ServerAdmin webmaster@hostlily.com UseCanonicalName Off CustomLog /usr/local/apache/domlogs/hostlily.com combined CustomLog /usr/local/apache/domlogs/hostlily.com-bytes_log "%{%s}t %I .\n%{%s}t %O ." ## User hostlily # Needed for Cpanel::ApacheConf <IfModule !mod_disable_suexec.c> SuexecUserGroup hostlily hostlily </IfModule> ScriptAlias /cgi-bin/ /home/hostlily/public_html/cgi-bin/ # To customize this VirtualHost use an include file at the following location # Include "/usr/local/apache/conf/userdata/hostlily/hostlily.com/*.conf" </VirtualHost> # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. # SSL <IfDefine SSL> </IfDefine> # DO NOT EDIT. AUTOMATICALLY GENERATED. IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES. # CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS <VirtualHost 69.64.38.19:80 *> ServerName air629.startdedicated.com ServerAlias cpanel.* whm.* webmail.* webdisk.* DocumentRoot /usr/local/apache/htdocs ServerAdmin info@lm-tek.com RewriteEngine On RewriteCond %{HTTP_HOST} ^cpanel\. RewriteRule ^/(.*) http://127.0.0.1:2082/$1 [P] RewriteCond %{HTTP_HOST} ^webmail\. RewriteRule ^/(.*) http://127.0.0.1:2095/$1 [P] RewriteCond %{HTTP_HOST} ^whm\. RewriteRule ^/(.*) http://127.0.0.1:2086/$1 [P] RewriteCond %{HTTP_HOST} ^webdisk\. RewriteRule ^/(.*) http://127.0.0.1:2077/$1 [P] UseCanonicalName Off </VirtualHost> Include "/usr/local/apache/conf/includes/post_virtualhost_global.conf" Include "/usr/local/apache/conf/includes/post_virtualhost_2.conf" Quote Link to comment https://forums.phpfreaks.com/topic/132175-dedicated-server-and-htaccess-problem/#findComment-687389 Share on other sites More sharing options...
advancedfuture Posted November 11, 2008 Author Share Posted November 11, 2008 okay so I know for a FACT that mod_rewrite is working, cuz I just used it to do URL redirection for another domain hosted on my server and that worked fine. So its something to do with writing SEF urls. Quote Link to comment https://forums.phpfreaks.com/topic/132175-dedicated-server-and-htaccess-problem/#findComment-687471 Share on other sites More sharing options...
corbin Posted November 11, 2008 Share Posted November 11, 2008 Do you get a 404 or 500 error? Quote Link to comment https://forums.phpfreaks.com/topic/132175-dedicated-server-and-htaccess-problem/#findComment-687481 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.