owncloud webpage has a redirect loop - apache

I have Ubuntu 14.04.3 LTS server on hyper-v virtual machine.
Mysql 14.14
Apache 2.4.7
php 5.5.9
Owncloud 8.1.3.0
After an unexpected shutdown of vm, main page have redirect loop. All attempts to modify htaccess not successful (i try deleted it, redirect remains). The following configuration of htaccess
<IfModule mod_headers.c>
<IfModule mod_fcgid.c>
<IfModule mod_setenvif.c>
SetEnvIfNoCase ^Authorization$ "(.+)" XAUTHORIZATION=$1
RequestHeader set XAuthorization %{XAUTHORIZATION}e env=XAUTHORIZATION
</IfModule>
</IfModule>
<IfModule mod_env.c>
# Add security and privacy related headers
Header set X-Content-Type-Options "nosniff"
Header set X-XSS-Protection "1; mode=block"
Header set X-Robots-Tag "none"
Header set X-Frame-Options "SAMEORIGIN"
SetEnv modHeadersAvailable true
</IfModule>
# Add cache control for CSS and JS files
<FilesMatch "\.(css|js)$">
Header set Cache-Control "max-age=7200, public"
</FilesMatch>
</IfModule>
<IfModule mod_php5.c>
php_value upload_max_filesize 10G
php_value post_max_size 10G
php_value memory_limit 512M
php_value mbstring.func_overload 0
php_value always_populate_raw_post_data -1
php_value default_charset 'UTF-8'
php_value output_buffering off
<IfModule mod_env.c>
SetEnv htaccessWorking true
</IfModule>
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^\.well-known/host-meta /public.php?service=host-meta [QSA,L]
RewriteRule ^\.well-known/host-meta\.json /public.php?service=host-meta-json [QSA,L]
RewriteRule ^\.well-known/carddav /remote.php/carddav/ [R=301,L]
RewriteRule ^\.well-known/caldav /remote.php/caldav/ [R=301,L]
RewriteRule ^apps/calendar/caldav\.php remote.php/caldav/ [QSA,L]
RewriteRule ^apps/contacts/carddav\.php remote.php/carddav/ [QSA,L]
RewriteRule ^remote/(.*) remote.php [QSA,L]
RewriteRule ^(build|tests|config|lib|3rdparty|templates)/.* - [R=404,L]
RewriteRule ^(\.|autotest|occ|issue|indie|db_|console).* - [R=404,L]
</IfModule>
<IfModule mod_mime.c>
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php index.html
</IfModule>
AddDefaultCharset utf-8
Options -Indexes
<IfModule pagespeed_module>
ModPagespeed Off
</IfModule>
ErrorDocument 403 /core/templates/403.php
ErrorDocument 404 /core/templates/404.php
And apache config
<VirtualHost *:80>
#ServerName ***
ServerAdmin ***
DocumentRoot /var/www/owncloud
<Directory /var/www/owncloud>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/owncloud-error.log
CustomLog ${APACHE_LOG_DIR}/owncloud-access.log combined
</VirtualHost>

DROP TABLE oc_storagecharts2;
DROP TABLE oc_storagecharts2_uconf;
rm -rf /var/www/owncloud/apps/storagecharts2
This helped me.

Related

Laravel in subfolder

I am trying to run laravel from a subfolder but my routes are incorrect.
My main page is loading correctly at mysite.co.uk/folder & the login auth works but it redirects me to mysite.co.uk. If I manually navigate to mysite.com/folder it is logged in correctly but all of the routes are messed up.
mysite.com/page is working but mysite.co.uk/folder/page gives me a 500 internal server error.
.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ folder/index.php [L]
</IfModule>
apache.conf
ServerName dev.mysite.co.uk
ServerAlias www.dev.mysite.co.uk
ServerAdmin info#dev.mysite.co.uk
DocumentRoot /home/admin/web/dev.mysite.co.uk/public_html
ScriptAlias /cgi-bin/ /home/admin/web/dev.mysite.co.uk/cgi-bin/
Alias /vstats/ /home/admin/web/dev.mysite.co.uk/stats/
Alias /error/ /home/admin/web/dev.mysite.co.uk/document_errors/
#SuexecUserGroup admin admin
CustomLog /var/log/apache2/domains/dev.mysite.co.uk.bytes bytes
CustomLog /var/log/apache2/domains/dev.mysite.co.uk.log combined
ErrorLog /var/log/apache2/domains/dev.mysite.co.uk.error.log
<Directory /home/admin/web/dev.mysite.co.uk/public_html>
AllowOverride All
SSLRequireSSL
Options +Includes -Indexes +ExecCGI
php_admin_value open_basedir /home/admin/web/dev.mysite.co.uk:/home/admin/tmp
php_admin_value upload_tmp_dir /home/admin/tmp
php_admin_value session.save_path /home/admin/tmp
</Directory>
<Directory /home/admin/web/dev.mysite.co.uk/stats>
AllowOverride All
</Directory>
SSLEngine on
SSLVerifyClient none
SSLCertificateFile /home/admin/conf/web/ssl.dev.mysite.co.uk.crt
SSLCertificateKeyFile /home/admin/conf/web/ssl.dev.mysite.co.uk.key
SSLCertificateChainFile /home/admin/conf/web/ssl.dev.mysite.co.uk.ca
<IfModule mod_ruid2.c>
RMode config
RUidGid admin admin
RGroups www-data
</IfModule>
<IfModule itk.c>
AssignUserID admin admin
</IfModule>
IncludeOptional /home/admin/conf/web/sapache2.dev.mysite.co.uk.conf*
You can simple change, inside the apache.conf, the
DocumentRoot
to:
/home/admin/web/dev.mysite.co.uk/public_html/folder
So you simple set the Root-Directory to the main site and don't need any further modifications.

Getting error while installing phabricator on centos 6

I am trying to install Phabricator on Centos, I have followed all steps of installation, but I am getting Request parameter '__path__' is not set. Your rewrite rules are not configured correctly.
Bellow is the virtual host entries.
<VirtualHost *:80>
ServerAdmin test#test.com
ServerName phabricator.test.com
DocumentRoot /var/www/html/myapps/phabricator/webroot/
RewriteEngine on
RewriteRule ^/rsrc/(.*)     -                       [L,QSA]
RewriteRule ^/favicon.ico   -                       [L,QSA]
RewriteRule ^(.*)$          /index.php?__path__=$1  [B,L,QSA]
ErrorLog logs/phabricator.test.com-error_log
CustomLog logs/phabricator.test.com-access_log common
<Directory "/var/www/html/myapps/phabricator/webroot/">
Order allow,deny
Allow from all
</Directory>
Any help would be appreciated.
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
I just kept above line in virtual host. Have removed following lines and restarted apache. Its working now for me.
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
I'm running phabricator on a centos7 system with apache 2.4.6.
You could use something like this:
NameVirtualHost *:443
<VirtualHost 192.168.0.1:443>
SSLEngine on
SSLCertificateFile /etc/pki/tls/certs/mycert.crt
SSLCertificateKeyFile /etc/pki/tls/private/mykey.pem
ServerName phabricator.myside.local
ServerAlias hostname.myside.local
# Change this to the path where you put 'phabricator' when you checked it
# out from GitHub when following the Installation Guide.
#
# Make sure you include "/webroot" at the end!
DocumentRoot /opt/phabricator/webroot
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^/rsrc/(.*) - [L,QSA]
RewriteRule ^/favicon.ico - [L,QSA]
RewriteRule ^(.*)$ /index.php?__path__=$1 [B,L,QSA]
</IfModule>
<Directory "/opt/phabricator/webroot">
Require all granted
</Directory>
## mod_php5 directives
<IfModule mod_php5.c>
php_admin_flag engine On
php_value upload_max_filesize 256M
php_value post_max_size 256M
php_value output_buffering 16384
php_admin_value date.timezone 'Europe/Berlin'
php_value include_path '.:/opt/PHPExcel/Classes/'
php_value memory_limit 256M
php_value always_populate_raw_post_data -1
</IfModule>
<LocationMatch "\.(?i:os)$">
ForceType application/octet-stream
Header set Content-Disposition attachment
</LocationMatch>
</VirtualHost>
Reduce the post_max_size and upload_max_filesize depending on your needs. We had some big binaries nested in the git repositories, so we had to increase it :)

apache2 redirect not adding trailing /

Okay so I am having a little difficulty with my site, I created a sub-domain and it points to the correct folder /var/www/html/pathfinder/ but it does not create the trailing slash www.example.com
that causes an issue because then it attempts to load css files at www.example.comcss/file.css
I am using SSL and can't figure out what I have done wrong.
<IfModule mod_ssl.c>
<VirtualHost *:443>
DocumentRoot /var/www/html/pathfinder
ServerName www.subdomain.example.com
ServerAlias subdomain.example.com
<Directory /var/www/html/pathfinder/>
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error_1.log
CustomLog ${APACHE_LOG_DIR}/access_1.log combined
SSLCertificateFile /etc/letsencrypt/live/www.subdomain.example.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www.subdomain.example.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
</IfModule>
# HTTPS over SSL version
# Information: https://github.com/exodus4d/pathfinder/wiki/Apache
# Enable rewrite engine and route requests to framework ===========================================
RewriteEngine On
# HTTP to HTTPS ===================================================================================
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$
RewriteCond %{HTTP_HOST} !=localhost
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Rewrite NONE www. to force www. =================================================================
RewriteCond %{HTTP_HOST} !^www\.
# skip "localhost" (dev environment)...
RewriteCond %{HTTP_HOST} !=localhost
# skip IP calls (dev environment)
RewriteCond %{HTTP_HOST} !^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$
# rewrite everything else to "https://" and "www."
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Some servers require you to specify the `RewriteBase` directive
# In such cases, it should be the path (relative to the document root)
# containing this .htaccess file:
# RewriteBase /app/
# Protect system files ============================================================================
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^(lib|tmp)\/|\.(ini|php)$ - [R=404]
# Rewrite "everything" to index.php (dispatcher) ==================================================
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L,QSA]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
# PHP global Vars (can be set in php.ini as well,...) =============================================
php_value max_input_vars 5000
php_value suhosin.get.max_vars 5000
php_value suhosin.post.max_vars 5000
php_value suhosin.request.max_vars 5000
# Activate PHP error log ==========================================================================
php_flag log_errors on
# php_value error_log "/www/htdocs/www.pathfinder-w.space/logs/php_errors.log"
# Cache Header ====================================================================================
# You should not change anything in here!
# New versioned files come with a unique path (e.g. ../js/v1.0.0/..) to force client cache busting.
<ifmodule mod_expires.c>
# fonts
<Filesmatch "\.(eot|woff2|woff|ttf|ttf|svg)$">
ExpiresActive on
ExpiresDefault "access plus 1 month"
Header append Cache-Control "public"
</Filesmatch>
# images/vector graphics
<Filesmatch "\.(jpg|jpeg|png|gif|swf|ico|svg)$">
ExpiresActive on
ExpiresDefault "access plus 1 year"
Header append Cache-Control "public"
FileETag None
Header unset ETag
</Filesmatch>
# css
<Filesmatch "\.(css)$">
ExpiresActive on
ExpiresDefault "access plus 1 month"
</Filesmatch>
## js/source maps
<Filesmatch "\.(js|map)$">
ExpiresActive on
ExpiresDefault "access plus 1 year"
Header append Cache-Control "public"
FileETag None
Header unset ETag
</Filesmatch>
# html templates
<Filesmatch "\.(htm|html)$">
ExpiresActive on
ExpiresDefault "access plus 1 week"
</Filesmatch>
</ifmodule>

Plesk WWW prefix

I'm having trouble with the WWW prefix for my domain. Whenever I goto the domain http://mydomain.com I get the correct index page. However, using the www prefix, I get the plesk default index page.
I have a subdomain called *.mydomain.com that points to it's parent httpdocs directory which is required for a url rewrite to our salespeople's profile pages (see below). There is also an alias for a completely different domain for mydomain.com (as you will see in last_httpd.include)
I can't seem to narrow it down. Commenting out the url rewrites in .htaccess didn't seem to work, neither did removing the *.mydomain.com subdomain.
I've provided what I can to perhaps give some insight to how things are setup. Thanks in advance for the help.
The www record in DNS is set as an A(host) record.
Here is the contents of my .htaccess file for the main domain. The domain name edited for obvious reasons...
#Gzip
<ifmodule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x- javascript application/javascript
</ifmodule>
#End Gzip
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.mydomain.com
RewriteCond %{HTTP_HOST} ^(.+).mydomain.com
RewriteRule ^(.*)$ http://mydomain.com/agents/agent.php?agent=%1 [P,L]
My last_http.include file for the main domain in /var/vhosts/www/mydomain.com/conf/
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
#
#IF YOU REQUIRE TO APPLY CUSTOM MODIFICATIONS, PERFORM THEM IN THE FOLLOWING FILES:
#/var/www/vhosts/mydomain.com/conf/vhost.conf
#/var/www/vhosts/mydomain.com/conf/vhost_ssl.conf
<IfModule mod_ssl.c>
<VirtualHost 10.10.10.10:443 >
ServerName "mydomain.com"
ServerAlias "www.mydomain.com"
ServerAlias "ipv4.mydomain.com"
UseCanonicalName Off
ServerAlias "mydomainalias.com"
ServerAlias "www.mydomainalias.com"
ServerAlias "ipv4.mydomainalias.com"
<IfModule mod_suexec.c>
SuexecUserGroup "mydomain" "psacln"
</IfModule>
ServerAdmin "admin#mydomain.com"
DocumentRoot "/var/www/vhosts/mydomain.com/httpdocs"
CustomLog /var/www/vhosts/mydomain.com/statistics/logs/access_ssl_log plesklog
ErrorLog "/var/www/vhosts/mydomain.com/statistics/logs/error_log"
<IfModule mod_userdir.c>
UserDir "/var/www/vhosts/mydomain.com/web_users"
</IfModule>
ScriptAlias "/cgi-bin/" "/var/www/vhosts/mydomain.com/cgi-bin/"
Alias "/plesk-stat" "/var/www/vhosts/mydomain.com/statistics"
<Location /plesk-stat/>
Options +Indexes
</Location>
<Location /plesk-stat/logs/>
Require valid-user
</Location>
Alias /webstat /var/www/vhosts/mydomain.com/statistics/webstat
Alias /webstat-ssl /var/www/vhosts/mydomain.com/statistics/webstat-ssl
Alias /ftpstat /var/www/vhosts/mydomain.com/statistics/ftpstat
Alias /anon_ftpstat /var/www/vhosts/mydomain.com/statistics/anon_ftpstat
Alias /awstats-icon /var/www/html/awstats/icon
SSLEngine on
SSLVerifyClient none
SSLCertificateFile /usr/local/psa/var/certificates/certQ69DPXb
SetEnv PP_CUSTOM_PHP_INI /var/www/vhosts/mydomain.com/etc/php.ini
<IfModule mod_fcgid.c>
FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/mydomain.com/etc/php.ini
FcgidMaxRequestLen 16777216
</IfModule>
<Directory /var/www/vhosts/mydomain.com/httpdocs>
<IfModule mod_perl.c>
<Files ~ (\.pl$)>
SetHandler perl-script
PerlHandler ModPerl::Registry
Options ExecCGI
allow from all
PerlSendHeader On
</Files>
</IfModule>
<IfModule sapi_apache2.c>
php_admin_flag engine on
# General settings
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/mydomain.com/:/tmp/"
php_admin_flag display_errors off
php_admin_flag log_errors on
php_admin_flag magic_quotes_gpc off
# Performance settings
php_admin_value memory_limit 64M
php_admin_value upload_max_filesize 256M
# Additional directives
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
# General settings
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/mydomain.com/:/tmp/"
php_admin_flag display_errors off
php_admin_flag log_errors on
php_admin_flag magic_quotes_gpc off
# Performance settings
php_admin_value memory_limit 64M
php_admin_value upload_max_filesize 256M
# Additional directives
</IfModule>
<IfModule mod_python.c>
<Files ~ (\.py$)>
SetHandler python-program
PythonHandler mod_python.cgihandler
</Files>
</IfModule>
<IfModule mod_fcgid.c>
<Files ~ (\.fcgi)>
SetHandler fcgid-script
Options +FollowSymLinks +ExecCGI
</Files>
</IfModule>
SSLRequireSSL
Options -Includes +ExecCGI
</Directory>
<Directory "/var/www/vhosts/mydomain.com/statistics">
AuthType Basic
AuthName "Domain statistics"
AuthUserFile "/var/www/vhosts/mydomain.com/pd/d..httpdocs#plesk-stat"
require valid-user
</Directory>
Alias /error_docs /var/www/vhosts/mydomain.com/error_docs
ErrorDocument 400 /error_docs/bad_request.html
ErrorDocument 401 /error_docs/unauthorized.html
ErrorDocument 403 /error_docs/forbidden.html
ErrorDocument 404 /error_docs/not_found.html
ErrorDocument 500 /error_docs/internal_server_error.html
ErrorDocument 405 /error_docs/method_not_allowed.html
ErrorDocument 406 /error_docs/not_acceptable.html
ErrorDocument 407 /error_docs/proxy_authentication_required.html
ErrorDocument 412 /error_docs/precondition_failed.html
ErrorDocument 414 /error_docs/request_uri_too_long.html
ErrorDocument 415 /error_docs/unsupported_media_type.html
ErrorDocument 501 /error_docs/not_implemented.html
ErrorDocument 502 /error_docs/bad_gateway.html
ErrorDocument 503 /error_docs/maintenance.html
Include "/usr/local/psa/admin/conf/file_sharing.conf*"
</VirtualHost>
</IfModule>
<VirtualHost 10.10.10.10:80 >
ServerName "mydomain.com"
ServerAlias "www.mydomain.com"
ServerAlias "ipv4.mydomain.com"
UseCanonicalName Off
ServerAlias "mydomainalias.com"
ServerAlias "www.mydomainalias.com"
ServerAlias "ipv4.mydomainalias.com"
<IfModule mod_suexec.c>
SuexecUserGroup "mydomain" "psacln"
</IfModule>
ServerAdmin "admin#mydomain.com"
DocumentRoot "/var/www/vhosts/mydomain.com/httpdocs"
CustomLog /var/www/vhosts/mydomain.com/statistics/logs/access_log plesklog
ErrorLog "/var/www/vhosts/mydomain.com/statistics/logs/error_log"
<IfModule mod_userdir.c>
UserDir "/var/www/vhosts/mydomain.com/web_users"
</IfModule>
ScriptAlias "/cgi-bin/" "/var/www/vhosts/mydomain.com/cgi-bin/"
Redirect permanent /plesk-stat https://mydomain.com/plesk-stat
Redirect permanent /webstat https://mydomain.com/webstat
Redirect permanent /webstat-ssl https://mydomain.com/webstat-ssl
Redirect permanent /ftpstat https://mydomain.com/ftpstat
Redirect permanent /anon_ftpstat https://mydomain.com/anon_ftpstat
Redirect permanent /awstats-icon https://mydomain.com/awstats-icon
<IfModule mod_ssl.c>
SSLEngine off
</IfModule>
SetEnv PP_CUSTOM_PHP_INI /var/www/vhosts/mydomain.com/etc/php.ini
<IfModule mod_fcgid.c>
FcgidInitialEnv PP_CUSTOM_PHP_INI /var/www/vhosts/mydomain.com/etc/php.ini
FcgidMaxRequestLen 16777216
</IfModule>
<Directory /var/www/vhosts/mydomain.com/httpdocs>
<IfModule mod_perl.c>
<Files ~ (\.pl$)>
SetHandler perl-script
PerlHandler ModPerl::Registry
Options ExecCGI
allow from all
PerlSendHeader On
</Files>
</IfModule>
<IfModule sapi_apache2.c>
php_admin_flag engine on
# General settings
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/mydomain.com/:/tmp/"
php_admin_flag display_errors off
php_admin_flag log_errors on
php_admin_flag magic_quotes_gpc off
# Performance settings
php_admin_value memory_limit 64M
php_admin_value upload_max_filesize 256M
# Additional directives
</IfModule>
<IfModule mod_php5.c>
php_admin_flag engine on
# General settings
php_admin_flag safe_mode off
php_admin_value open_basedir "/var/www/vhosts/mydomain.com/:/tmp/"
php_admin_flag display_errors off
php_admin_flag log_errors on
php_admin_flag magic_quotes_gpc off
# Performance settings
php_admin_value memory_limit 64M
php_admin_value upload_max_filesize 256M
# Additional directives
</IfModule>
<IfModule mod_python.c>
<Files ~ (\.py$)>
SetHandler python-program
PythonHandler mod_python.cgihandler
</Files>
</IfModule>
<IfModule mod_fcgid.c>
<Files ~ (\.fcgi)>
SetHandler fcgid-script
Options +FollowSymLinks +ExecCGI
</Files>
</IfModule>
Options -Includes +ExecCGI
</Directory>
<Directory "/var/www/vhosts/mydomain.com/statistics">
AuthType Basic
AuthName "Domain statistics"
AuthUserFile "/var/www/vhosts/mydomain.com/pd/d..httpdocs#plesk-stat"
require valid-user
</Directory>
Alias /error_docs /var/www/vhosts/mydomain.com/error_docs
ErrorDocument 400 /error_docs/bad_request.html
ErrorDocument 401 /error_docs/unauthorized.html
ErrorDocument 403 /error_docs/forbidden.html
ErrorDocument 404 /error_docs/not_found.html
ErrorDocument 500 /error_docs/internal_server_error.html
ErrorDocument 405 /error_docs/method_not_allowed.html
ErrorDocument 406 /error_docs/not_acceptable.html
ErrorDocument 407 /error_docs/proxy_authentication_required.html
ErrorDocument 412 /error_docs/precondition_failed.html
ErrorDocument 414 /error_docs/request_uri_too_long.html
ErrorDocument 415 /error_docs/unsupported_media_type.html
ErrorDocument 501 /error_docs/not_implemented.html
ErrorDocument 502 /error_docs/bad_gateway.html
ErrorDocument 503 /error_docs/maintenance.html
Include "/usr/local/psa/admin/conf/file_sharing.conf*"
</VirtualHost>
What is the http code response from server? You can check it in Firebug on "Net" tab.
Check that www.mydomain.com resolves to same IP as mydomain.com (nslookup www.mydomain.com)
check that apache's config is applied: apachectl -S / apache2ctl -S | grep www.mydomain.com

url to new format

Given below is my .htaccess file. It is not working on localhost apache (www is root directory on C:/apache/www) "url" is directory and I want output like this
http://localhost/url/index.php?username=shah
to
http://localhost/url/shah
I change windows host file 127.0.0.1 localhost
& also enable mod_rewrite in httpd.conf file & AllowOverride none to AllowOverride All
& root Directory to C:/apache/www
//==============================HTaccess==================================//
Options:
# -MultiViews: Turns off multiviews so it doesn't interfer with our rewrite rules
# -Indexes: Stop directory listings
# +FollowSymlinks: Let out rewrite rules work
Options -MultiViews -Indexes +FollowSymlinks
<IfModule mod_security.c>
# Turn off mod_security filtering.
# SecFilterEngine Off
# The below probably isn't needed, but better safe than sorry.
SecFilterScanPOST Off
</IfModule>
ErrorDocument 404 /url/404.php
<IfModule mod_php5.c>
php_value register_globals 0
php_value magic_quotes_gpc 0
php_value session.auto_start 0
php_value safe_mode 0
</IfModule>
<IfModule sapi_apache2.c>
php_value register_globals 0
php_value magic_quotes_gpc 0
php_value session.auto_start 0
php_value safe_mode 0
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /url/
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?username=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?username=$1
#RewriteRule ^view-content/([^/]*)/([^/]*)\.html$ content.php?pageid=$1&title=$2 [L]
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/x-javascript text/css text/html text/xml
</IfModule>
//==============================HTaccess==================================//
Please tell me what to do?
Try this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /url/
RewriteCond %{QUERY_STRING} username\=(.*)
RewriteRule index\.php$ /url/%1
Hope this helps you... :)
If you really want to redirect a request of /url/index.php?username=shah externally to /url/shah, try this rule:
RewriteCond %{QUERY_STRING} ^(([^&]*&)*?)username=([^&]+)&*(.*)
RewriteRule ^index\.php$ /url/%3?%1%4 [L,R=301]
Otherwise, for the reverse direction:
RewriteCond $0 !=index.php
RewriteRule ^[^/]+$ index.php?username=$0 [L,QSA]