Search Results

Search found 2190 results on 88 pages for 'htaccess'.

Page 13/88 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • .htaccess rewrite all queries to static page

    - by user127219
    I have an account where hundreds of inbound links to their calender are showing up as 404 (they moved their site to a new platform). I would like to make a wildcard redirection of all URLs with a query to their old event calender to land on a new static page, and do the same for their webstore queries. I've tried several variations, but can't seem to get it to work. CASE 1: I need to redirect URLs like these (note the difference between "showDay" and "showWeek"): apps/calendar/showWeek?calID=5107976&year=2011&month=7&day=10 apps/calendar/showDay?calID=5107976&year=2011&month=9&day=10 To: http://domain.com/events/ CASE 2: And also URLs like these: apps/webstore/products/show/1927074 TO: http://subdomain.domain.com/ I can't seem to get the syntax right to take all of the URLS and redirect them. I'm looking for the equivalent of a wildcard like "apps/calendar/*" would give you at a command line. Any help is appreciated!

    Read the article

  • Slash-started resources redirection in HTML with .htaccess

    - by Pawka
    I have moved old version of webpage to some subdirectory: http://www.smth.com/old/. But all resources (images, css, etc.) in HTML are linked with slash symbol at the start. So browser still tries to load them from root path. For example old/test.html contains: <img src="/images/lma_logo.ico" /> <!-- not working !--> <img src="images/lma_logo.ico" /> <!-- working !--> How can I rewrite ulrs to load resources from the "old" dir if urls still starts with "/"?

    Read the article

  • Can anyone tell me whats wrong with this htaccess code

    - by mathew
    I am not able to get through with this code...I need to capture the request but with this code I am able to redirect but it cannot find the particular search page. RewriteCond %{THE_REQUEST} ^[A-Z]+\ /searcha\.php\?name=(www\.)?([^/\ ]+)[^\ ]*\ HTTP/ RewriteRule ^.*$ http://www.mydomain.com/%2? [R=301,L] can any one tell me what is I am missing??

    Read the article

  • .htaccess redirect root directory and subpages with parameters

    - by wali
    I am having difficulty trying to redirect a root directory while at the same time redirect pages in a sub directory to a different URL. For example: http://test.example.com/olddir/sub/page.php?v=one to http://test.example.com/new/one while also redirecting the any request to the root of the olddir folder. I have tried RewriteCond %{QUERY_STRING} v=one RewriteRule ^/olddir/sub/page.php /new/? [R=301] and RedirectMatch /oldir "test.example.com" RedirectMatch /olddir/sub/page.php?v=one "test.example.com/new/one" Any help at this point will be extremely appreciated...Thanks!

    Read the article

  • htaccess redirect loop

    - by Web Developer
    I am having issue in the last line of the below code which is causing the redirect loop (at least that's what i think so) RewriteEngine On RewriteBase /jgel/ RewriteCond %{REMOTE_ADDR} !^172\.172\.121\.142 RewriteCond %{REQUEST_URI} !maintainance\.php RewriteCond %{REQUEST_URI} !resources/(.*)$ [nc] RewriteRule ^(.*)$ maintenance.php [R=307,L] I have tried this and this too doesn't work RewriteEngine On RewriteBase / RewriteCond %{REMOTE_ADDR} !^172\.172\.121\.142 RewriteCond %{REQUEST_URI} !maintainance\.php RewriteCond %{REQUEST_URI} !resources/(.*)$ [nc] RewriteRule ^(.*)$ /jgel/maintenance.php [R=307,L]

    Read the article

  • Virtual host doesn't read .htaccess

    - by Charlie
    I just created virtual host: <VirtualHost myvirtualhost:80> ServerAdmin webmaster@myvirtualhost ServerName myvirtualhost DocumentRoot /home/myname/sites/public_html <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /home/myname/sites/public_html/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> It works, but it cant read .htacces file in public_html: DirectoryIndex otherindex.php I tried change all AllowOverride to All, but I get 500 error. How can I fix this ? thanks.

    Read the article

  • How to exclude IP from htaccess domain redirect

    - by ijujym
    I'm trying to write a custom redirect rule for some testing purposes on 2 domains with exactly same site. The code I am using is: RewriteEngine on RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4$ RewriteCond %{HTTP_HOST} ^.*site1.com [NC] RewriteRule ^(.*)$ http://www.site2.com/$1 [R=301,L] What I want is to redirect all requests for site1 to site2 except for requests from IP address 1.2.3.4. But currently requests from that IP are also being redirected to site2. Is there something I've missed in settings? ( note: both domains are on the same shared hosting account )

    Read the article

  • Resources started with slash .htaccess redirection

    - by Pawka
    I have moved old version of webpage to some subdirectory: http://www.smth.com/old/. But all resources (images, css, etc.) in HTML are linked with slash symbol at the start. So browser still tries to load them from root path. For example old/test.html contains: <img src="/images/lma_logo.ico" /> <!-- not working !--> <img src="images/lma_logo.ico" /> <!-- working !--> How can I rewrite ulrs to load resources from the "old" dir if urls still starts with "/"?

    Read the article

  • htaccess rewrite?

    - by flyenig
    i have a script that uploads images, creates a hash for it, creates 3 directories, and stores the image to imgs/f3s/v5g/234/536_f3sv5g2344270fd093ee8a9bf8de3de32dad.jpg (the “536_” is the user id) so im trying to turn imgs/f3s/v5g/234/536_f3sv5g2344270fd093ee8a9bf8de3de32dad.jpg into user_pics/536/536_f3sv5g2344270fd093ee8a9bf8de3de32dad.jpg how can i do that? i want that if someone wants to view the photo, they see the new directory in the url, not the one with 3 sub directories.

    Read the article

  • htaccess rewrite domain/folder to domain/

    - by user1678259
    I've been checking all questions previously made here, but can't find a solution. We have a website nearly finished www.example.com/web/ and would like to hide the folder /web/ from the url. So what is shown is: www.example.com/web/* And would like: www.example.com/* If we try with a redirect, the url www.example.com goes to www.example.com/web/. And this is what we don't want. Any help will be very appreciated. Thank you all.

    Read the article

  • .htaccess help required for appache server

    - by mathew
    I searching for a redirection code for my url: what I want is when some one search in my site it should redirect example: if some one search google.com on mysite then in address line it should look like www.mydomain.com/google.com can be in $_POST method or $_GET how do I do that??

    Read the article

  • Overriding IndexIgnore in .htaccess file

    - by vsr
    I have IndexIgnore * in a directory for which I don't want to allow directory listing. Now, in a sub-directory, I want to override the IndexIgnore directive defined in parent directory and allow directory listing. The documentation for IndexIgnore says The IndexIgnore directive adds to the list of files to hide when listing a directory. How do I allow directory listing for this sub-directory?

    Read the article

  • .htaccess to pass FULL URL into other PHP link as $_GET

    - by 4lvin
    From .htacces file, how to pass/redirect the FULL URL to another URL as GET Variable? Like: http://www.test.com/foo/bar.asp will be redirected to: http://www.newsite.com/?url=http://www.test.com/foo/bar.asp With Full Url with Domain.I tried: RewriteEngine on RedirectMatch 301 ^/(.*)\.asp http://www.newsite.com/?url=%{REQUEST_URI} But it is going out like: http://www.newsite.com/?url=?%{REQUEST_URI}

    Read the article

  • Serve pages based on domain by using htaccess

    - by Safwan Erooth
    I have a site mysite.com with different sections. There are several domains pointing to the same site. What I'm trying to achieve is. Say if my site has the domains mysite.com, section1.com and section2.com. If the user comes from section1.com the user should get mysite.com/section1/ it should not be redirected, it should be rewritten like this : mysite.com/section1/something should become section1.com/something mysite.com/section1/another should become section1.com/another Same way if the user is coming from section2.com the content served should be mysite.com/section2/ and the domain rewritten like mysite.com/section2/something should become section2.com/something mysite.com/section2/another should become section2.com/another

    Read the article

  • django urlconf or .htaccess trouble

    - by Zayatzz
    Hello I am running my django project from subfolder of a website. Lets say the address where my project is meant to open from is. http://example.com/myproject/ the myproject folder is root folder for my user account. In that folder i have fcgi script that starts my project. The .htaccess file in the folder contains this: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L] The trouble is, that at some cases, instead of redireting user to page like http://example.com/myproject/social/someurl/ it redirects to http://example.com/social/someurl/ which does not work. What i want to know is how to fix this problem. Is this django problem and i should change it with urconf and add myproject to all urls, or should i do this with .htaccess? I found similar question, which, sadly, remains unanswered: http://stackoverflow.com/questions/2321154/how-to-write-htaccess-if-django-project-is-in-subfolder-and-subdomain Alan.

    Read the article

  • Redirect to a specific url depending upon the base url using htaccess file

    - by Goysar
    I am using htaccess to redirect to url with page description. For example RewriteRule ^Flash$ /index.php?section=flash [L,NC] By using this code when i hot domain.com/Flash it redirects me to www.domain.com/index.php? section=flash. This works fine. But now what i want to have two more site with the same htaccess file. So can anyone help me in redirecting the url with same htaccess for multiple site. Can i find the base url and redirect depending on that??

    Read the article

  • Building path independent mod_rewrite statements for generic .htaccess file

    - by Pekka
    Say I have three small web applications stored under a shared web root: www.example.com/app1/ www.example.com/app2/ www.example.com/app3/ www.example.com/app4/ each application has a .htaccess file containing some run-off-the-mill mod_rewrite statements to rewrite urls like RewriteCond %{REQUEST_URI} ^/app1/([^/]+)/([^/]+)\.html$ RewriteRule .* /app1/index.php?selectedProfile=%1&match=%2&%{QUERY_STRING} now, I would like to have a generic .htaccess file in each /app{n} directory. So, no RewriteBase and no /app{n} prefix in the RewriteConds. One idea I had was making the first level a wildcard directory as well: RewriteCond %{REQUEST_URI} ^/([^/]+)/([^/]+)/([^/]+)\.html$ seeing as the .htaccess file gets triggered only when the /app{n} directory is entered, this should work. Is this an acceptable solution? Are there other, better ones?

    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

  • htaccess/htpasswd in hierarchical folder structure

    - by chessweb
    I have a folder (folder_1) that is protected by htaccess/htpasswd files. Inside that folder is another folder (folder_2) that is protected by another couple of htaccess/htpasswd files. When a php-script in folder_1 or folder_2 is called, the user has to authenticate herself using the correct username and password as specified in the respective htaccess/htpasswd files. This works as intended. However, as soon as the php-script in folder_2 tries to refer to another script or a css-file that is located in folder_1, the user must enter username and password for folder_1 as well. Is there a way to avoid this that does not involve copying scripts and css-files from folder_1 to folder_2? Regards, Ralf

    Read the article

  • Site images don't refresh after setting expired headers on .htaccess

    - by Miguel Hernandez
    I have a site that uses a CSS sprite for all the images. I set the .htaccess file to set the expired headers to a future time as they recommend to improve site performance. However, when I updated the sprite image none of my browsers on two different computers seem to fetch the new image. I deleted the .htaccess serveral times but no luck. I am sure this must be easy as pie to fix but right now I am out of options. Here is the code inside my .htaccess file: # CONFIGURE media caching # Header unset ETag FileETag None <FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css)$"> Header unset Last-Modified Header set Expires "Fri, 21 Dec 2012 00:00:00 GMT" Header set Cache-Control "public, no-transform" </FilesMatch> <IfModule mod_deflate.c> <FilesMatch "\.(js|css)$"> SetOutputFilter DEFLATE </FilesMatch> </IfModule> Thanks!

    Read the article

  • .htaccess newb - RewriteRule not matching 2nd rule, why?

    - by jyoseph
    I am currently migrating from isapi_rewrite to .htaccess. I'm having some difficulty and I think it's something basic, but I'm not terribly familiar with .htaccess. I have the two rules like so: RewriteRule ^testing/ /test/index.html?test=1 [NC] RewriteRule ^testing/foo-bar/ /test/index.html?test=2 [NC] Yet the second rule never matches. If I go to http://mydomain.com/testing/foo-bar/ then I will only see the first rule. Why is that? And can it be easily fixed? I have many rules (outputted from the database to write the .htaccess file )and ordering them in a particular order isn't really possible.

    Read the article

  • How to determine MIME Type set by htaccess in PHP

    - by Ed Marty
    I have a .htaccess file set up to define specific MIME types in directory root/a/b/, and all of the files are in the same directory. I have a php file that wants to serve those files, in directory root/c/, and needs to determine the content-type as defined by the .htaccess file. Is there any way to do this? PHP version is 5.1.6. mime_content_type returns text/plain, and I'd rather not try to parse the .htaccess file manually. I can move the file if necessary.

    Read the article

  • Using htaccess rewrite to make a subdirectory be its own root for root relative path requests

    - by Scott
    Can I use htaccess to capture requests from a certain subdirectory and make that directory use itself as the root directory for any root relative path requests? For example if I have... http://www.example.com/subFIXED/subANY/restofpath ...where subFIXED is always the same directory, subANY is any immediate subdirectory of subFIXED, and I want a redirection of all href/src requests from any file under subANY to use subANY as the 'root' (sort of like a subdomain), in effect having root level requests use this as the root directory level: http://www.example.com/subFIXED/subANY/ Instead of this: http://www.example.com/ I'm assuming I can put an htaccess file in subFIXED to handle all calls coming from anything under any subANY, but not being very familiar with htaccess rewriting, variables, etc., I can't figure out how to capture which subANY directory is making the root level request and then use that capture to make a rewrite to consider that directory the root level of any root relative path requests from it. Thanks for your help

    Read the article

  • .htaccess cross browser

    - by lordsharp
    Hi, Im trying to load a custom error document for a 404 error using a .htaccess file on a linux server, the page gets the current page URL then redirects to another site (which is retrieved from a db) based on an id it retrieved from the URL. The current error documents are stored here: /error_docs/ - i dont have permission to upload anything other than the HTML files that are already in there /HTTPDocs/301redir.php is the site root where the .htaccess file is. i have used the following to load the 301redir.php page as the error doc, which works in FF but no other browsers. ErrorDocument 404 /310redir.php using .htaccess is my only real option for changing this, is there a way to get around this issue and make it work across all browsers?

    Read the article

  • Prevent .htaccess syntax error

    - by seengee
    Hi, As part of one our system's we enable a user in the backoffice to add a block of 301 redirects should they need to. This is just a textarea which then populates a specific area of a .htaccess file. As much as this may seem insecure it has only previously used internally by people who know what they are doing but for various reasons they cannot access the specific file. We need now to allow more access to this function, not for the general public, but for people that probably have far less knowledge of regexp etc and syntax in htaccess files. Obviously the major concern here is the user enters some bad syntax and makes their entire site, including the backoffice where they could fix the issue, totally inaccessible without manual intervention. What approaches can i take to make sure that they do not break their site? A htaccess syntax check? copy the file elsewhere and check it doesnt generate a 500 error (with cURL or similar)?. Would welcome any ideas. Thanks.

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >