Search Results

Search found 906 results on 37 pages for 'rewriteengine'.

Page 3/37 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Why are perfectly legitamate pages on my website registering in google Webmasters as 404?

    - by christian
    I have seen this question asked several times here, but never clearly answered. I suspect it has something to do with my .htaccess file: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^moreinfo/(.*)$ http://www.kgstiles.com/moreinfo$1 [R=301] RewriteRule ^healthsolutions/(.*)$ http://www.kgstiles.com/healthsolutions$1 [R=301] RewriteRule ^(.*)\.html$ $1/ [R=301] RewriteRule ^(.*)\.htm$ $1/ [R=301] </IfModule> when I check the url without a forward slash at the end, it registers as 404 (even though it renders fine in a browser), but when I write it without the forward slash at the end, it renders 200 OK, but if I try to take off the forward slash with the htaccess file, the browser gives me a 310 error (too many redirects) you can see the 404 and 310 with this url: http://www.kgstiles.com/pureplantessentials.html which redirects to http://www.kgstiles.com/pureplantessentials/ (which is a 404), so what is a solution and why might this be registering as a 404? Any Help is appreciated! (I'm using wordpress btw)

    Read the article

  • htaccess/cPanel 301 redirects not working for add-on domain

    - by Clemens
    I've already looked at many samples and tutorials how to set up those 301 redirects on Apache and can't figure out why only the second one is working: Options +FollowSymlinks RewriteEngine on #doesn't work: RewriteCond %{HTTP_HOST} ^old.com$ [OR] RewriteCond %{HTTP_HOST} ^www.old.com$ RewriteRule ^page-still-exists.htm$ "http://www.new.com/new-target-page.htm" [R=301,L] #works: RewriteCond %{HTTP_HOST} ^old.com$ [OR] RewriteCond %{HTTP_HOST} ^www.old.com$ RewriteRule ^page-does-no-longer-exist.htm$ "http://www.new.com/" [R=301,L] #works: RewriteCond %{HTTP_HOST} ^old.com$ [OR] RewriteCond %{HTTP_HOST} ^www.old.com$ RewriteRule ^folder/otherpage.htm$ "http://www.new.com/" [R=301,L] #works: RewriteCond %{HTTP_HOST} ^old.com$ [OR] RewriteCond %{HTTP_HOST} ^www.old.com$ RewriteRule ^/?$ "http://www.new.com/" [R=301,L] #doesn't work: RewriteCond %{HTTP_HOST} ^old.com$ [OR] RewriteCond %{HTTP_HOST} ^www.old.com$ RewriteRule ^somepage.htm$ "http://www.old.com/some-page.htm" [R=301,L] I have no idea why only the second one is working. The only difference I can see is, that in the second case the old page does no longer exist on the old domain. But whenever I want to redirect any still existing page from the old domain to the new domain the page on the old domain is still used. Any input is much appreciated because this is slowly driving me crazy :) EDIT: I added the complete htaccess file. EDIT 2: So I removed almost all redirects and currently my htaccess looks like this: Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} ^old\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.old\.com$ RewriteRule ^(.*)$ "http\:\/\/www\.new\.com\/$1" [R=301,L] The only redirect that is working is the simple one from old.com to new.com. A redirect like old.com/page.htm to new.com or even new.com/page.htm is not working. And actually I really don't know where this redirect is actually coming from... Can a 301 really be so complicated?

    Read the article

  • Restrict SSL access for some paths on a apache2 server

    - by valmar
    I wanted to allow access to www.mydomain.com/login through ssl only. E.g.: Whenever someone accessed http://www.mydomain.com/login, I wanted him to be redirect to https://www.mydomain.com/login so it's impossible for him/her to access that site without SSL. I accomplished this by adding the following lines to the virtual host for www.mydomain.com on port 80 in /etc/apache2/sites-available/default: RewriteEngine on RewriteCond %{SERVER_PORT} ^80$ RewriteRule ^/login(.*)$ https://%{SERVER_NAME}/login$1 [L,R] RewriteLog "/var/log/apache2/rewrite.log" Now, I want to restrict using SSL for www.mydomain.com. That means, whenever someone accessed https://www.mydomain.com, I want him to be redirected to http://www.mydomain.com (for performance reasons). I tried this by adding the following lines to the virtual host of www.mydomain.com on port 443 in /etc/apache2/sites-available/default-ssl: RewriteEngine on RewriteCond %{SERVER_PORT} ^443$ RewriteRule ^/(.*)$ http://%{SERVER_NAME}/$1 [L,R] RewriteLog "/var/log/apache2/rewrite.log" But when I now try to access www.mydomain.com/login, I get an error message that the server has caused to many redirects. That does make sense. Obviously, the two RewriteRules are playing ping-pong against each other. How could I work around this?

    Read the article

  • Apache: Virtual Host and .htacess for URL Rewriting not working

    - by parth
    I have configured a virtual host in my local machine and every thing is working fine. Now I want to use SEO friendly urls. To achieve this I have used the .htaccess file. My virtual host configuration is: <VirtualHost *:80> DocumentRoot "C:/xampp/htdocs/ypp" ServerName ypp.com ServerAlias www.ypp.com ##ErrorLog "logs/dummy-host2.localhost-error.log" ##CustomLog "logs/dummy-host2.localhost-access.log" combined </VirtualHost> and my .htaccess file has: AllowOverride All RewriteEngine On RewriteBase /ypp/ RewriteRule ^/browse$ /browse.php RewriteRule ^/browse/([a-z]+)$ /browse.php?cat=$1 RewriteRule ^/browse/([a-z]+)/([a-z]+)$ /browse.php?cat=$1&subcat=$2 The above .htaccess setting is not working. After that I modified my virtual host setting and it is working. The new virtual host setting is: <VirtualHost *:80> RewriteEngine On RewriteRule ^/browse$ /browse.php RewriteRule ^/browse/([a-z]+)$ /browse.php?cat=$1 RewriteRule ^/browse/([a-z]+)/([a-z]+)$ /browse.php?cat=$1&subcat=$2 ServerAdmin [email protected] DocumentRoot "C:/xampp/htdocs/ypp" ServerName ypp.com ServerAlias www.ypp.com ##ErrorLog "logs/dummy-host2.localhost-error.log" ##CustomLog "logs/dummy-host2.localhost-access.log" combined <Directory "C:/xampp/htdocs/ypp"> AllowOverride All </Directory> </VirtualHost> Please let me know where I am going wrong in the .htacess file for url rewriting. I do not want to use the settings in virtual host, since for every change I have restart apache.

    Read the article

  • Restrict SSL access for some paths on a apache2 server

    - by valmar
    I wanted to allow access to www.mydomain.com/login through ssl only. E.g.: Whenever someone accessed http://www.mydomain.com/login, I wanted him to be redirect to https://www.mydomain.com/login so it's impossible for him/her to access that site without SSL. I accomplished this by adding the following lines to the virtual host for www.mydomain.com on port 80 in /etc/apache2/sites-available/default: RewriteEngine on RewriteCond %{SERVER_PORT} ^80$ RewriteRule ^/login(.*)$ https://%{SERVER_NAME}/login$1 [L,R] RewriteLog "/var/log/apache2/rewrite.log" Now, I want to restrict using SSL for www.mydomain.com. That means, whenever someone accessed https://www.mydomain.com, I want him to be redirected to http://www.mydomain.com (for performance reasons). I tried this by adding the following lines to the virtual host of www.mydomain.com on port 443 in /etc/apache2/sites-available/default-ssl: RewriteEngine on RewriteCond %{SERVER_PORT} ^443$ RewriteRule ^/(.*)$ http://%{SERVER_NAME}/$1 [L,R] RewriteLog "/var/log/apache2/rewrite.log" But when I now try to access www.mydomain.com/login, I get an error message that the server has caused to many redirects. That does make sense. Obviously, the two RewriteRules are playing ping-pong against each other. How could I work around this?

    Read the article

  • Apache: Virtual Host and .htacess for URL Rewriting not working

    - by parth
    I have configured virtual host in my local machine and every thing working fine . Now I want to use SEO friendly urls. To achive this I have used .htacess file . My virtual host configuration is : <VirtualHost *:80> DocumentRoot "C:/xampp/htdocs/ypp" ServerName ypp.com ServerAlias www.ypp.com ##ErrorLog "logs/dummy-host2.localhost-error.log" ##CustomLog "logs/dummy-host2.localhost-access.log" combined </VirtualHost> and my .htacess file has : AllowOverride All RewriteEngine On RewriteBase /ypp/ RewriteRule ^/browse$ /browse.php RewriteRule ^/browse/([a-z]+)$ /browse.php?cat=$1 RewriteRule ^/browse/([a-z]+)/([a-z]+)$ /browse.php?cat=$1&subcat=$2 The above .htacess setting is not working . After that I have modigied my virtual host setting and it is working . new virtual host setting is : <VirtualHost *:80> RewriteEngine On RewriteRule ^/browse$ /browse.php RewriteRule ^/browse/([a-z]+)$ /browse.php?cat=$1 RewriteRule ^/browse/([a-z]+)/([a-z]+)$ /browse.php?cat=$1&subcat=$2 ServerAdmin [email protected] DocumentRoot "C:/xampp/htdocs/ypp" ServerName ypp.com ServerAlias www.ypp.com ##ErrorLog "logs/dummy-host2.localhost-error.log" ##CustomLog "logs/dummy-host2.localhost-access.log" combined <Directory "C:/xampp/htdocs/ypp"> AllowOverride All </Directory> </VirtualHost> Please guide me where I am wrong in .htacess file for url rewriting . I donot want to use setting in virtual host because for every change I have restart apache .

    Read the article

  • Properly force SSL with .htaccess, no double authentication

    - by cwd
    I'm trying to force SSL with .htaccess on a shared host. This means there I only have access to .htaccess and not the vhosts config. I know you can put a rule in the VirtualHost config file to force SSL which will be picked up there (and acted upon first), preventing double authentication, but I can't get to that. Here's the progress I've made: Config 1 This works pretty well but it does force double authentication if you visit http://site.com - once for http and then once for https. Once you are logged in, it automatically redirects http://site.com/page1.html to the https coutnerpart just fine: RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteEngine on RewriteCond %{HTTP_HOST} !(^www\.site\.com*)$ RewriteRule (.*) https://www.site.com$1 [R=301,L] AuthName "Locked" AuthUserFile "/home/.htpasswd" AuthType Basic require valid-user Config 2 If I add this to the top of the file, it works a lot better in that it will switch to SSL before prompting for the password: SSLOptions +StrictRequire SSLRequireSSL SSLRequire %{HTTP_HOST} eq "site.com" ErrorDocument 403 https://site.com It's clever how it will use the SSLRequireSSL option and the ErrorDocument403 to redirect to the secure version of the site. My only complaint is that if you try and access http://site.com/page1.html it will redirect to https://site.com/ So it is forcing SSL without a double-login, but it is not properly forwarding non-SSL resources to their SSL counterparts. Regarding the first config, Insyte mentioned "using mod_rewrite to perform a simple redirect is a bit of overkill. Use the Redirect directive instead. It's possible this may even fix your problem, as I believe mod_rewrite rules are some of the last directives to be processed, just before the file is actually grabbed from the filesystem" I have not had no such luck on finding a force-ssl config option with the redirect directive and so have been unable to test this theory.

    Read the article

  • Disallow all user agents except one using .htaccess?

    - by Kian Mayne
    I've been struggling to get this .htaccess working. The aim is to disallow all user agents besides my app. The app sends a GET request with a user agent of lets say 'AcmeUpdater'. Whenever I try to navigate to any file in the folder, I get a 500 - Internal Server Error. Here are the rules I'm using: <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{HTTP_USER_AGENT} !^KMUpdaterClient* RewriteRule .* - [F,L] </IfModule> I have updated the .htaccess file as suggested in the answer by Nick, and restarted Apache. After trying a couple of different things, it seems that just the presence of a .htaccess is causing the 500 error. I'm getting nothing in the error logs. The .htaccess file at the document root looks like the following: <IfModule mod_rewrite.c> Options +FollowSymLinks ErrorDocument 404 /index.php?error=404 RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d </IfModule> So I realised that the error logs were in chronological order rather than the reverse chronological I expected (Oops!). The error I'm getting is: </IfModule> without matching <IfModule> section. I removed the </IfModule> and still I get that error. Ideas?

    Read the article

  • Wordpress .htaccess preventing subfolder access

    - by John K.
    This is sort of a goofy setup, but it's not in my power to reconfigure it at this time. I'm running in a shared hosting environment. The domain is example.com. This is an add-on domain on the host side with example.com being redirected to the www/example.com sub-directory. That directory houses a standard Wordpress site which acts as the main site when you visit example.com. The .htaccess file within that directory is: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^wp-admin/profile\.php$ /ssm/welcome [R] </IfModule> I have a subdirectory, at the root level with the /example.com subdirectory that houses a cake php application. That subdirectory is /tracker. My problem is that when I attempt to browse to example.com/tracker, I get a 404 from Wordpress because perma links are on. What I think I need is a rewrite rule in the Wordpress .htaccess file that short circuits the existing rewrite rules and permits example.com/tracker to work independently of the Wordpress install. Or a rewrite rule at the root level that short circuits the redirect to the /example.com directory in the first place. Not sure how well I explained that so here's a summary. The www/ directory structure: example.com/ tracker/ Add on domain of www.example.com redirecting to the /example.com directory with Wordpress and a tracker/ directory running CakePHP which I would like to access via www.example.com/tracker. If you need further info or clarification let me know!

    Read the article

  • .htaccess rules to rewrite URLs to front end page?

    - by Dizzley
    I am adding a new application to my site at example.com/app. I want views at that URL to always open myapp.php. E.g. example.com/app -> example.com/app/myapp.php and example.com/app/ -> example.com/app/myapp.php What's the correct form of rewrite rules in the .htaccess file? I've got: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /app/ RewriteRule ^myapp\.php$ - [L] RewriteRule ^myapp.php$ - [L] RewriteRule . - [L] </IfModule> ...based on what the Wordpress front-end does. But all I see at example.com/app is a directory of files. :( (I put those rewrites at the top of my .htaccess file). Any ideas? Update What actually worked: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^/app(/.*)?$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . /app/myapp.php [L] This is good because: Explicit or implicit calls to app/myapp.php work. example.com/app redirects to app/myapp.php example.com/app/ redirects to app/myapp.php example.com/app/subfunction redirects to app/myapp.php All other calls to example.com/otherstuff are untouched. Item 4 is Wordpress-like Front Controller pattern behaviour. I think that rule RewriteCond %{REQUEST_URI} ^/app.*$ [NC] needs refining as it allows /app-oh-my-goodness etc. through too. Thanks for the answers.

    Read the article

  • Best way to setup hosts, subdomains, and IPs [closed]

    - by LynnOwens
    I own a domain, let's call it mydomain.com. I need to host the following off it: forums.mydomain.com www.mydomain.com blog.mydomain.com objects.mydomain.com I believe I can get 5 static IPs. I plan on assigning one each to those four hosts. Then I need to adhoc create names, all below objects.mydomain.com. For instance: one.objects.mydomain.com two.objects.mydomain.com three.objects.mydomain.com I need to create these names programatically, and without human intervention. Preferably, they would not get their own IPs. They would use the IP of objects.mydomain.com. First question: Does this mean that I need to host my own DNS? Second question: I'm using Apache as a web server. What does the virtual host configuration look like? I was experimenting with the following to understand how routing on domain names works and I always ended up at www. <VirtualHost *:80> ServerAdmin [email protected] ServerName www.mydomain.com ServerAlias www.mydomain.com DocumentRoot "E:/Static/www" RewriteEngine On RewriteRule ^(/www/.*) /www$1 </Virtualhost> <VirtualHost *:80> ServerAdmin [email protected] ServerName forums.mydomain.com ServerAlias forums.mydomain.com DocumentRoot "E:/Static/forums" RewriteEngine On RewriteRule ^(/forums/.*) /forums$1 </Virtualhost>

    Read the article

  • Use mod_rewrite to redirect from example.com/dir to www.example.com/dir

    - by kavoir.com
    Assume / is the document root of my domain example.com. /.htaccess RewriteEngine on RewriteCond %{HTTP_HOST} ^golfcoursesd\.com$ [NC] RewriteRule ^(.*)$ http://www.golfcoursesd.com/$1 [R=301,L] /dir/.htaccess <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /dir/index.php [L] </IfModule> I know how to redirect example.com/dir to www.example.com/dir, because /.htaccess does the very job. However, the trick here is that I have to keep /dir/.htaccess to serve up virtual directories (such as /dir/state/AK/35827/ which aren't actual directories) if you know what I mean. Problem is, if I keep /dir/.htaccess, a request of: http://example.com/dir/state/AK/35827/ DOES NOT redirect to: http://www.example.com/dir/state/AK/35827/ as would: http://example.com/ redirect to: http://www.example.com/ Not sure if I made it clear. Basically, how to make http://example.com/dir/state/AK/35827/ correctly redirect to http://www.example.com/dir/state/AK/35827/ AND I can serve virtual URLs?

    Read the article

  • one page over 9 different urls

    - by Ali Demirtas
    Hi I am using prestashop as the cart for my website. I have a problem; the website used to be in dynamic urls. I enabled friendly url writing. The problem is that one page has more than one url. You can access a same page from the dynamic url and static url. In fact a single page has 9 different urls. This obviously creates problems for seo as search engines penalize my website for this. Here are examples of a page with more than 2 urls (http://www.turkishfootballstore.com/lang-nl/product.php?id_product=515) (http://www.turkishfootballstore.com/fenerbahce/515-fenerbahce-thuisshirt-20092010.html) (http://www.turkishfootballstore.com/lang-nl/fenerbahce/515-fenerbahce-thuisshirt-20092010.html) you can see even the static url's have 2 one with language defined and the other without. out fo the three urls above the correct one is the one at the bottom. What can I do to solve this problem? I have no knowledge of programming. Here is the htaccess for the website. Any sample code or help is really appreciated. There is 550 pages and every page is published in 17 different languages I want to use a 301 auto redirect. What is the simplest way to do it? I have no idea of coding. # URL rewriting module activation RewriteEngine on # URL rewriting rules RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2$3.jpg [L,E] RewriteRule ^([0-9]+)\-([0-9]+)/([_a-zA-Z0-9-]*)\.jpg$ /img/p/$1-$2.jpg [L,E] RewriteRule ^([0-9]+)(\-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*)\.jpg$ /img/c/$1$2.jpg [L,E] RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$3&isolang=$1$5 [L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2&isolang=$1$4 [L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$2&isolang=$1 [QSA,L,E] RewriteRule ^([a-zA-Z0-9-]*)/([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$2$4 [L,E] RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)\.html(.*)$ /product.php?id_product=$1$3 [L,E] RewriteRule ^([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /category.php?id_category=$1 [QSA,L,E] RewriteRule ^content/([0-9]+)\-([a-zA-Z0-9-]*)(.*)$ /cms.php?id_cms=$1 [QSA,L,E] RewriteRule ^([0-9]+)__([a-zA-Z0-9-]*)(.*)$ /supplier.php?id_supplier=$1$3 [QSA,L,E] RewriteRule ^([0-9]+)_([a-zA-Z0-9-]*)(.*)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E] RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E] # Catch 404 errors ErrorDocument 404 /404.php Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^***.com [NC] RewriteRule ^(.*)$ http://www.***.com/$1 [L,R=301] Options +FollowSymLinks RewriteEngine on # index.php to / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/ RewriteRule ^(.*)index\.php$ /$1 [R=301,L] Header set Cache-Control: "no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0"

    Read the article

  • .htaccess redirect with other settings

    - by Zack
    I am using CakePHP framework, it redirect everything to the app folder using .htaccess, and then I set up a WordPress blog in /news/ folder outside of CakePHP, so I don't want everything in /news/ to be redirect, so I modify the .htaccess, and here is the final version: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^/news/(.*)$ RewriteRule ^.*$ - [L] </IfModule> <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule> And here is the question: I want to redirect mydomain/super to mydomain/news/super, how to do this without infecting other settings?

    Read the article

  • one page has 9 urls. I am looking for 301 auto redirect syntax for multiple urls.

    - by Ali Demirtas
    Hi This is the third time I am asking this question. I am only looking for the syntax of how to solve this problem. I am using prestashop as the cart for my website. I have a problem; the website used to be in dynamic urls. I enabled friendly url writing. The problem is that one page has more than one url. You can access a same page from the dynamic url and static url. In fact a single page has 9 different urls. This obviously creates problems for seo as search engines penalize my website for this. Here are examples of a page with more than 2 urls (http://www.turkishfootballstore.com/lang-nl/product.php?id_product=515) (http://www.turkishfootballstore.com/fenerbahce/515-fenerbahce-thuisshirt-20092010.html) (http://www.turkishfootballstore.com/lang-nl/fenerbahce/515-fenerbahce-thuisshirt-20092010.html) you can see even the static url's have 2 one with language defined and the other without. out fo the three urls above the correct one is the one at the bottom. What can I do to solve this problem? I have no knowledge of programming. Here is the htaccess for the website. Any sample code or help is really appreciated. There is 550 pages and every page is published in 17 different languages I want to use a 301 auto redirect. What is the simplest way to do it? Please only reply if you have the coding for a auto 301 redirect! URL rewriting module activation RewriteEngine on URL rewriting rules RewriteRule ^([a-z0-9]+)-([a-z0-9]+)(-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]*).jpg$ /img/p/$1-$2$3.jpg [L,E] RewriteRule ^([0-9]+)-([0-9]+)/([_a-zA-Z0-9-]*).jpg$ /img/p/$1-$2.jpg [L,E] RewriteRule ^([0-9]+)(-[_a-zA-Z0-9-]*)/([_a-zA-Z0-9-]).jpg$ /img/c/$1$2.jpg [L,E] RewriteRule ^lang-([a-z]{2})/([a-zA-Z0-9-])/([0-9]+)-([a-zA-Z0-9-]).html(.)$ /product.php?id_product=$3&isolang=$1$5 [L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)-([a-zA-Z0-9-]).html(.)$ /product.php?id_product=$2&isolang=$1$4 [L,E] RewriteRule ^lang-([a-z]{2})/([0-9]+)-([a-zA-Z0-9-])(.)$ /category.php?id_category=$2&isolang=$1 [QSA,L,E] RewriteRule ^([a-zA-Z0-9-])/([0-9]+)-([a-zA-Z0-9-]).html(.*)$ /product.php?id_product=$2$4 [L,E] RewriteRule ^([0-9]+)-([a-zA-Z0-9-]).html(.)$ /product.php?id_product=$1$3 [L,E] RewriteRule ^([0-9]+)-([a-zA-Z0-9-])(.)$ /category.php?id_category=$1 [QSA,L,E] RewriteRule ^content/([0-9]+)-([a-zA-Z0-9-])(.)$ /cms.php?id_cms=$1 [QSA,L,E] RewriteRule ^([0-9]+)__([a-zA-Z0-9-])(.)$ /supplier.php?id_supplier=$1$3 [QSA,L,E] RewriteRule ^([0-9]+)_([a-zA-Z0-9-])(.)$ /manufacturer.php?id_manufacturer=$1$3 [QSA,L,E] RewriteRule ^lang-([a-z]{2})/(.*)$ /$2?isolang=$1 [QSA,L,E] Catch 404 errors ErrorDocument 404 /404.php Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^.com [NC] RewriteRule ^(.)$ http://www.*.com/$1 [L,R=301] Options +FollowSymLinks RewriteEngine on index.php to / RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.index.php\ HTTP/ RewriteRule ^(.)index.php$ /$1 [R=301,L] Header set Cache-Control: "no-store, no-cache, must-revalidate, pre-check=0, post-check=0, max-age=0"

    Read the article

  • Does mod_rewrite in subdirectories' .htaccess override higher levels?

    - by Ryan
    I'm using mod_rewrite to map my old directory structure to a new one. I have the following rule in my top-level .htaccess file, and it works: RewriteEngine On RewriteCond %{REQUEST_URI} /blog/archives/(.*) RewriteRule ^.*$ /archives/%1 [L,R=301] As you can guess, this takes http://example.com/blog/archives/00001.php and redirects it to http://example.com/archives/00001.php. But when I add these rewrite rules to the .htaccess file in the /blog directory RewriteEngine on RewriteRule atom.xml$ /atom.xml [L,R=301] the top-level redirect no longer works. If I move the rule in the /blog .htaccess file to the top-levle file both rules work. Can someone explain what is happening here?

    Read the article

  • modrewrite RewriteRule problem

    - by timpone
    I am using Apache 2.2 and mod_rewrite. I would like to take the following urls and map them to another url. The pattern is simple and like this: http://domain/test/ex1.html - http://domain/app/index.php/content/?name=ex1 I tried the following in an .htaccess file: RewriteEngine On RewriteBase /app/ RewriteRule (.*)\.html index.php/content/?name=$1 and RewriteEngine On RewriteRule (.*)\.html /app/index.php/content/?name=$1 I wasn't sure if the backreference was correct so set to $0 and $2 but never seemed to help. I also tried setting the RewriteLogLevel to 9. There is a step where it is almost there: rewrite 'ex1.html' - 'index.php/content/?name=ex1' The last line of the rewrite log is as follows: [perdir /var/www/domain/htdocs/test/] internal redirect with /app/index.php/content/ [INTERNAL REDIRECT] How can I get this to rewrite to /app/index.php/content/?name=ex1 ? thanks

    Read the article

  • htaccess problem

    - by ruru
    RewriteEngine On RewriteBase /home RewriteRule ^()$ index.php [NC,L] Rewritecond %{REQUEST_URI} !(^/?.*\..*$) [NC] RewriteRule (.*)$ $1.php [NC] i got css problem(got blank) when i type http://dot.com/home/index.php/

    Read the article

  • Invisible .htaccess Redirect from /public_html/ to /public_html/folder

    - by dosboy
    I need to point the root domain of my hosting account to a subdirectory (joomla). I want this to be invisible (i.e. browser address bar doesn't change). Also, I need this to work when a user hits the root or a subfile/subfolder. I've tried the following rules, which work individually, but I can't get them to work together. This one works when no subfile/subfolder is specified: RewriteEngine On RewriteRule ^$ /joomla/ [L] And this one works when a subfile/subfolder IS specified: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule (.+)$ /joomla/$1 [L] I just can't figure out how to combine them.

    Read the article

  • mod_rewrite RewriteRule is not working

    - by buggy1985
    Hi, This is a follow-up of this question: Rewrite URL - how to get the hostname and the path? I got this Rewrite Rule: RewriteEngine On RewriteRule ^(http://[-A-Za-z0-9+&@#/%=~_|!:,.;]*)/([-A-Za-z0-9+&@#/%=~_|!:,.;]*)\?([A-Za-z0-9+&@#/%=~_|!:,.;]*)$ http://http://www.xmldomain.com/bla/$2?$3&rtype=xslt&xsl=$1/$2.xsl it seems to be correct, and exactly what I need. But it doesn't work on my server. I get a 404 page not found error. mod_rewrite is enabled, as the following simple rule is working fine: RewriteEngine On RewriteRule ^page/([^/\.]+)/?$ index.php?page=$1 [L] Can you help? Thanks

    Read the article

  • Zend Framework on a Shared Host

    - by manyxcxi
    I am trying to push my first ZF project to my shared hosting provider. I have done a lot of testing on my home server and everything is working great. My issue is that I do not know how to set up my .htaccess files on the shared hosting provider to make it work correctly. The ZF documentation says to configure my Apache config VirtualServer DocumentRoot to /whatever/path/project-folder/public, but I don't have that kind of access. How do I get around this? I have seen http://stackoverflow.com/questions/1115547/zend-framework-on-shared-hosting but none of those solutions have worked for me. My application path looks like this / - .htaccess - /application ... - /public -- .htaccess -- index.php -- ... ... My .htaccess files look like: /.htaccess RewriteEngine On RewriteRule !\.(js|gif|jpg|png|css|txt)$ public/index.php [L] RewriteCond %{REQUEST_URI} !^/public/ RewriteRule ^(.*)$ public/$1 [L] /public/.htaccess RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ index.php [NC,L]

    Read the article

  • WordPress sub domain htacess problem

    - by user260165
    Well i did a wordpress installation with the newer version now avaialble at dere website.. i did my installation at a subdomain : foo.abc.com the problem came with the permalink which do not work dere bec of the htaccess file. Can any one suggest me how to do that, i need to have only the category/postname Till now i am able to do foo.abc.com/index.php/category/postname - i dont want index.php in it. I have used this htacess file : disable the rewrite engine RewriteEngine on BEGIN WordPress RewriteEngine On RewriteBase /blog/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] RewriteRule ^post/([0-9]+)?/?([0-9]+)?/?$ /index.php?p=$1&page=$2 [QSA] END WordPress Please correct me if possible. thanks

    Read the article

  • Using htaccess redirect all files to another domain but exclude the root domain.

    - by Shawn
    Recently, I want to restructure and redesign my website, my old website located at www.example.com, there are lots of blog posts under this domain, like: www.example.com/post1 www.example.com/post2 www.example.com/post3 ... I can redirect all those posts to another sub domain points in another folder (not sub folder), (if I put all those posts in a sub folder, it will recursive the subfolder name) , anyway, it works for me by using the code below: RewriteEngine On RewriteRule ^(.*)$ http://pre.example.com/$1 [L,R=301] But there is one things I want to do is not redirect the main domain, only all the posts. RewriteEngine on RewriteCond %{REQUEST_URI} !^/blog/ # the new blog # I tried below #RewriteCond %{REQUEST_URI} !^/$ #RewriteCond %{REQUEST_URI} !^www.example.com$ RewriteRule ^(.*)$ http://pre.example.com/$1 [L,R=301] Is it possible I can do that? Thx.

    Read the article

  • htaccess: how to prevent infinite subdirectories?

    - by Vincent Isles
    My .htaccess at the root directory contains this: Options -MultiViews +FollowSymlinks -Indexes ErrorDocument 404 /404.htm RewriteEngine On RewriteBase / followed by a bunch of RewriteRules. The .htaccess at the /forum subdirectory contains this: RewriteEngine On RewriteBase /forum RewriteRule ^index.html$ index.php [L,NE] RewriteRule ^(.*)-t-([0-9]+).html(.*)$ showthread.php?tid=$2$3 [QSA,L] RewriteRule ^(.*)-t-([0-9]+)-([0-9]+).html$ showthread.php?tid=$2&page=$3 [QSA,L] followed by other rules mapping SEO-friendly URLs to the true URLs. mydomain.com/forum/a-thread-t-1.html returns the page showthread.php?tid=1 but so does mydomain.com/forum/forum/a-thread-t-1.html, mydomain.com/forum/forum/forum/a-thread-t-1.html and so on. I don't want this behavior - I want pages accessed as /forum/forum/* to return a 404. Any hint on where I had been wrong?

    Read the article

  • Wordpress htaccess in root overriding htaccess in subdomain. Subdomain app not working now.

    - by revive
    Hello, We have a WP install in the root of our server and its running great.. but, we just installed another app in a subdomain. Now, I can view the index.php of that app but cannot do anything with it.. the htaccess rules in the root (from WP base install) are effecting the requests. So, how to I eliminate the WP htaccess file from effecting the subdomain? Here is the htaccess contents for the root (WP install): <IfModule mod_rewrite.c> RewriteEngine On # BEGIN WordPress RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress </IfModule> And for the htaccess in the subdomain: RewriteEngine on RewriteCond $1 !^(index\.php|css|stylesheets|js|images|user_guide|favicon\.ico|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L] I've search everywhere online and tried a couple samples I found.. nothing has worked. Any help is greatly appreciated ! Thanks

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >