Search Results

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

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

  • mod_rewrite and relative urls

    - by Davide Gualano
    I'm setting up some simple url rewriting rules using mod_rewrite and a .htacces file, but I've got some problems. If I set up the .htacces this way: Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule /index.html /index.php [L] when I call from the browser this url: http://localhost/~dave/mySite/index.html I got a 404 error. Using this .htacces instead Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule /index.html http://localhost/~dave/mySite/index.php [L] everything works fine and I get the index.php page I'm expecting. Am I forced to user absolute urls as the target of a rewrite? Is this a Apache configuration problem? I'm using Max OS X 10.6.2 with its standard Apache installation.

    Read the article

  • getting error 500 with .htaccess when pointing an existing file / folder (mod_rewrite)

    - by Leto
    i made a simple .htaccess file to expose the problem. I want that all request made to the folder redirect to a subfolder file "app/index.php" RewriteEngine On RewriteRule (.*) app/index.php [QSA] And this works fine on with the basic url of my hoster (like http//myname.hosting.com/htaccessFolder The problem is that i have a domain pointing on this folder, and when accessed to it, server return Internal Server Error 500. If i do this : RewriteEngine On RewriteRule (.*) somefile.php [QSA] Redirection works only when file does not exists (404 not found error occured). when the file exists i get a 500 error too. I've asked the hosting support without success for the moment..

    Read the article

  • .htaccess setting is not working on Google Chrome

    - 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> It's working fine in IE and FireFox, I can visit mydomain/news/, but in Google Chrome, it still redirects to CakePHP app folder. How can I fix this?

    Read the article

  • Mod_rewrite trouble: Want to direct from ?= to a flat link, nothing seems to work.

    - by Davezatch
    I have a site that currently serves results as example.com/index.php?show=foo and I'd like it to read example.com/show/foo. My understanding is this would make them visible to search engine robots, and it seems a much simpler way to do this than to create a couple hundred html files... I've tried the following .htaccess code: Options +FollowSymLinks RewriteEngine on RewriteRule ^show/(.*)$ index.php?show=$1 [NC,L] No dice. Also tried this, which I found on another stack overflow question: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([0-9A-Za-z]+)/?$ /index.php?show=$1 [L] </IfModule> Any ideas on what I'm missing here?

    Read the article

  • WordPress 2.9.2 htaccess curruption issue strikes again (in Patched site)

    - by Scott B
    The htaccess file below crashed the site with an internal server error (500). This site has the misc.php patch that's discussed here: Wordpress Bug #11903 Apparently something else is at play here or the patch is not fully addressing the issue. 3 sites went down yesterday. 2 today (so far). All sites have the patch file that's referenced in the bug track link above. AuthName mysite.net AuthUserFile /home/mysite/public_html/_vti_pvt/service.pwd AuthGroupFile /home/mysite/public_html/_vti_pvt/service.grp Options All -Indexes # BEGIN WordPress # BEGIN WordPress root <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress root dule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress root

    Read the article

  • Configure clean URLs using Laravel using a rewrite rule to index.php

    - by yannis hristofakis
    Recently I've started learning Laravel , I have none experience with framework before. I'm encountering the following problem .I'm trying to configure the .htaccess file so I can have clean URLs but the only thing I get are 404 Not Found error pages. I have created a virtual host - you can see below the configuration file - and changed the .htaccesss file on the public directory. /etc/apache2/sites-available <VirtualHost *:80> ServerAdmin [email protected] ServerName laravel.lar DocumentRoot "/home/giannis/Desktop/laravel/public" <Directory "/home/giannis/Desktop/laravel/public"> Options Indexes FollowSymLinks MultiViews AllowOverride All </Directory> <Directory /var/www/> 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 ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/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> </VirtualHost> .htaccesss file: laravel/public # Apache configuration file # http://httpd.apache.org/docs/current/mod/quickreference.html # Note: ".htaccess" files are an overhead for each request. This logic should # be placed in your Apache config whenever possible. # http://httpd.apache.org/docs/current/howto/htaccess.html # Turning on the rewrite engine is necessary for the following rules and # features. "+FollowSymLinks" must be enabled for this to work symbolically. <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On </IfModule> # For all files not found in the file system, reroute the request to the # "index.php" front controller, keeping the query string intact <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L] </IfModule> In order to test it, I have created a view named about and made the proper routing. If I link to http://laravel.lar/index.php/about/ I'm routing to the about page instead if I link to http://laravel.lar/about/ I get a 404 Not Found error. I'm using a Debian based system.

    Read the article

  • Error 404 after rewrite query strings with htaccess

    - by Cristian
    I'm trying to redirect the URLs of a client's website like this: www.localsite.com/immobile.php?id_immobile=24 In something like this: www.localsite.com/immobile/24.php I'm using this rule in .htaccess but it returns a 404 error page. RewriteEngine On RewriteCond %{QUERY_STRING} ^id_immobile=([0-9]*)$ RewriteRule ^immobile\.php$ http://localsite.com/immobile/%1.php? [L] I have tried many other rules, but none work. What can I do?

    Read the article

  • Propagaging Apache rules Automatically for all folders Beneath Root

    - by Sam
    Hi folks, my webroot folder /httpdocs folder contains a .htaccess file The first lines look like this: RewriteEngine on RewriteBase / AddDefaultCharset UTF-8 Options +FollowSymLinks -Indexes -ExecCGI # DirectoryIndex index.php /index.php # ServerSignature Off Now, I want all settings that I have set it to, to be propagated automatically to other folders as well. How can I do that? Thanks very much for suggestions.

    Read the article

  • Help with Apache mod_rewrite rules

    - by Brian Neal
    I want to change some legacy URL's like this: /modules.php?name=News&file=article&sid=600 to this: /news/story/600/ This is what I have tried: RewriteEngine on RewriteCond %{QUERY_STRING} ^name=News&file=([a-z_]+)&sid=([0-9]+) RewriteRule ^modules\.php /news/story/%2/ [R=301,L] However I still get 404's on the old URLs. I do have some other rewrite rules working, so I am pretty sure mod_rewrite is enabled and functioning. Any ideas? Thanks.

    Read the article

  • getting 500 intenal error when setting 301 redirect using .htaccess

    - by sam
    im trying to use a 301 redirect to direct users and bots to my new site but when i put the .htaccess live i keep getting a 500 internal error shown. The site is actually a subdomain which i want to redirect to another subdomain on another site (im not sure if thats relivant but i thought i should include it) the site is hosted on a apache server The 301 htaccess code im using is : Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.blog.mysite.co.uk/$1 [R=301,L] any idea what might be wrong with this ?

    Read the article

  • apache rewriting url doesn't work(using godaddy hosting)

    - by AzizAG
    I'm using a framework to create my website(codeigniter) by default the urls are like this:mysite.com/index.php?/etc/etc/etc. And I'm trying to remove the index.php?, I tried to remove it by doing this(didn't work): RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?$1 [L] Note: it's working on my localhost(when putting my website's files in the root directiory). So, Is this issue associated with me or the hosting company(Go Daddy)?

    Read the article

  • I need a little help with .htaccess rewrite

    - by Pinokyo
    I need a little help with .htaccess file I have songs, singers and albums links I want to rewrite. I all ready rewrote the links and they are like this: the links for the songs is like this: /song/song_name for singers: /singer_name for albums: /album_name From my .htaccess file: RewriteEngine on RewriteRule ^singer/([^/\.]+)/?$ /core/controller.php?singer=$1 [L] RewriteRule ^song/([^/\.]+)/?$ /core/controller.php?song=$1 [L] RewriteRule ^album/([^/\.]+)/?$ /core/controller.php?album=$1 [L] I need the links for the songs, singers and albums to be like this: for songs /singer_name/song_name for singers /singer_name for albums /singer_name/album_name can anyone help me with this please.

    Read the article

  • web.config to redirect except some given IPs

    - by Alvin
    I'm looking for a web.config which is equivalent as the .htaccess file below. <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REMOTE_HOST} !^123\.123\.123\.123 RewriteCond %{REMOTE_HOST} !^321\.321\.321\.321 RewriteCond %{REQUEST_URI} !/coming-soon\.html$ RewriteRule (.*)$ /coming-soon.html [R=302,L] </IfModule> Which redirects everyone to a coming soon page except for the given IPs. Unfortunately I'm not familiar with IIS. Thank you

    Read the article

  • .htaccess - lose the file .html extension

    - by Darren Sweeney
    I'm having a bad .htaccess day! I want a user to be able to type the URL mysite.com/about instead of mysite.com/about.html On .htaccess file I have: RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^/(.*)$ /$1.html [NC,L] But this simply does not work? I will add though that if i try this further inside the site e.g. mysite.com/pages/contact Works perfectly whether I have the above code in the .htaccess or not What am I doing wrong?

    Read the article

  • What's wrong with my htaccess ? (500 Error)

    - by Dany Khalife
    I've written a small htaccess file to redirect Internet Explorer users to a specific page Here are the contents : # MS Internet Explorer - Mozilla v4 RewriteEngine On RewriteCond %{HTTP_USER_AGENT} ^Mozilla/4(.*)MSIE RewriteRule ^index\.php$ /sorry.php [L] # All other browsers #RewriteRule ^index\.html$ /index.32.html [L] Any clue why this would give a 500 Internal Server Error ? I have used mod rewrite before so i have the module loaded there...

    Read the article

  • Extend depth of .htaccess to all subfolders and their children

    - by JoXll
    I need to be able to use .htaccess in all subfolders for full depth. E.g. I have .htaccess in public_html folder: \public_html\.htaccess How I make it to work for the folder small as well? \public_html\home\images\red\thumbs\small\ It only enforces up to home directory not more. ErrorDocument 403 http://google.com Order Deny,Allow Deny from all Allow from 11.22.33.44 Options +FollowSymlinks RewriteEngine On RewriteCond %{HTTPS} off RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

    Read the article

  • Getting problem in removing end slash from directory

    - by user2615947
    this is my code but i tried many ways but it is not working and i am not able to remove the end slash from the directory RewriteEngine On RewriteBase / # remove enter code here.php; use THE_REQUEST to prevent infinite loops RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP RewriteRule (.*)\.php$ $1 [R=301] # remove index RewriteRule (.*)/index$ $1/ [R=301] # remove slash if not directory RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} /$ RewriteRule (.*)/ $1 [R=301] # add .php to access file, but don't redirect RewriteCond %{REQUEST_FILENAME}.php -f RewriteCond %{REQUEST_URI} !/$ RewriteRule (.*) $1\.php [L] # Remove trailing slashes RewriteRule ^(.*)\/(\?.*)?$ $1$2 [R=301,L] Thanks

    Read the article

  • Using a front controller design pattern doesn't allow images to be served

    - by MrMe TumbsUp
    I am currently using a front controller. All requests for my website go through it. I have a problem with image links like: <img src="img/image.jpg" /> Then my front controller will try to dispatch the request to: application/controller/ImgController.php. Then the image won't load. I think it has something to do with the .htaccess file: 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

  • htaccess rewrite doesn't work

    - by Raimond van Mouche
    I'm trying to redirect url's in my /joomla/ folder containing "rsform" to the same url but except for /joomla/ /formulieren/. However my tried .htaccess rewrite doesn't work. I tried: RewriteEngine on RewriteCond %{REQUEST_URI} rsform RewriteRule ^(.+)$ http://watervriendengeleen.nl/joomla/ [L,R=301] And other URL related rewrites like Redirect /joomla/index.php?option=com_rsform&formId=12&Itemid=99999 http://sitename.com/formulieren/index.php?option=com_rsform&formId=12&Itemid=99999 which didn't work either. Any thoughts?

    Read the article

  • Force www. on multi domain site and retain http or https

    - by John Isaacks
    I am using CakePHP which already contains an .htaccess file that looks like: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule> I want to force www. (unless it is a subdomain) to avoid duplicate content penalties. It needs to retain http or https Also This application will have multiple domains pointing to it. So the code needs to be able to work with any domain.

    Read the article

  • mod_rewrite problems - redirect subdomain to different domain

    - by Tom
    I must have a brain freeze as I can not get my rewrite rules working. RewriteEngine On RewriteCond %{HTTP_HOST} ^otherdomain\.example\.com [NC] RewriteRule ^(.*) http://www.otherdomain.com/ [R=permanent,L] RewriteCond %{HTTP_HOST} ^(www\.)?example\.com [NC] RewriteCond %{REQUEST_URI} ^/otherdomain [NC] RewriteRule ^(.*) http://www.otherdomain.com/ [R=permanent,L] What I want is essential to redirect otherdomain.example.com and example.com/otherdomain to otherdomain.com

    Read the article

  • apache2 and htaccess help

    - by user1052448
    For some reason domain.com/YYYY-MM-DD redirects to domain.com/var/htdocs/public_html RewriteEngine On RewriteCond %{HTTP_HOST} ^[^\./]+\.[^\./]+$ RewriteRule ^/(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteRule ^archive/index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^. /archive/index.php [L] trying to get anything after www.domain.com other than index.php and archive/index.php to display mysql content on archive/index.php (by grabbing PHP Request URI). The browser URL should remain www.domain.com/YYYY/MM/DD/blog-title or www.domain.com/YYYY/MM/ to display all posts from YYYY-MM

    Read the article

  • Links don't work on new server

    - by Beko
    I've recently moved from server with php4 to php5. Now I cant open content in my page. Links look like this "page.com/news-it-is-rainy-day-1.html". But when I try to open link I just get the archive (news.html). I also use smarty template engine. My rewrite rule in .htacces looks like this: Options +FollowSymlinks RewriteEngine on RewriteRule ^news-(.*)\.html$ news.php?do=read&id=$1 RewriteRule ^news.html$ news.php RewriteRule ^index.html$ index.php AddType application/x-httpd-php .xml

    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

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