Search Results

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

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

  • RewriteRule not working for certain URLs

    - by keiki
    There are a few domains pointing towards the same server, and of course I need them all redirect to only one of them. Redirects work, but only for certain URLs. What works: http://www.domain.com, http://domain.com, domain.com/index.html, domain.com/index.php, , domain.com/nonExistentDirectory, and if I click in the menu the following URLs are also redirected correctly: domain.com/foo/bar, domain.com/foo/bar.html or .php or other extension. What doesn't work: domain.com/existentDirectory, domain.com/foo/bar (if I type the URL in the address bar). If anyone will have the time and skill and will to tell me where's the mistake, I'll be deeply grateful. Here's my .htaccess file: AddHandler x-httpd-php .html .htm <ifModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* </ifModule> <ifModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 seconds" ExpiresByType text/html "access plus 1 seconds" ExpiresByType image/gif "access plus 2592000 seconds" ExpiresByType image/jpeg "access plus 2592000 seconds" ExpiresByType image/png "access plus 2592000 seconds" ExpiresByType text/css "access plus 2592000 seconds" ExpiresByType text/javascript "access plus 216000 seconds" ExpiresByType application/x-javascript "access plus 216000 seconds" </ifModule> <ifModule mod_headers.c> <filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$"> Header set Cache-Control "max-age=2592000, public" </filesMatch> <filesMatch "\\.(css)$"> Header set Cache-Control "max-age=2592000, public" </filesMatch> <filesMatch "\\.(js)$"> Header set Cache-Control "max-age=216000, private" </filesMatch> <filesMatch "\\.(xml|txt)$"> Header set Cache-Control "max-age=216000, public, must-revalidate" </filesMatch> <filesMatch "\\.(html|htm|php)$"> Header set Cache-Control "max-age=1, private, must-revalidate" </filesMatch> </ifModule> <ifModule mod_headers.c> Header unset ETag </ifModule> FileETag None <ifModule mod_headers.c> Header unset Last-Modified </ifModule> # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress RewriteCond %{HTTP_HOST} ^foo\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.foo\.com$ RewriteRule (.*) http://domain.com/$1 [R=301,L,QSA] RewriteCond %{HTTP_HOST} ^foo1\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.foo1\.com$ RewriteRule (.*) http://domain.com/$1 [R=301,L,QSA] RewriteCond %{HTTP_HOST} ^foo2\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.foo2\.com$ RewriteRule (.*) http://domain.com/$1 [R=301,L,QSA] RewriteCond %{HTTP_HOST} ^foo3\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.foo3\.com$ RewriteRule (.*) http://domain.com/$1 [R=301,L,QSA] RewriteCond %{HTTP_HOST} ^foo8\.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.foo8\.com$ RewriteRule (.*) http://domain.com/$1 [R=301,L,QSA] Thinking that the above version was overkill, I've also tried to redirect all the requests for domains different than the main on to be redirected to it like this: RewriteCond %{HTTP_HOST} !^domain\.com$ [NC] RewriteRule ^(.*)$ http://domain.com [L,R=301] Is it also wrong? Because it doesn't work either! P.S. @Sodved I've tried that and it doesn't help (I comment here because I can't seem to be able to comment your answer.) Removing the following piece of code didn't solve the issue either, so the problem must be somewhere else: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress New details: using this tool for checking the redirects I got the following results for the URLs that are not redirected: Checked link: http://domain.com/aDirectory/ Type of link: direct link (note the trailing slash above) and: Checked link: http://domain.com/aDirectory Type of redirect: 301 Moved Permanently Redirected to: http://domain.com/aDirectory/ (no trailing slash here) I hope/suspect I'm getting closer to the cause of this behavior.

    Read the article

  • php symfony and apache2 - inst't serving .phtml

    - by pmoniq
    Hi, I have a problem with apache2 settings (Ubuntu system). I would like to run symfony project on my localhost but instead of serving .phtml files, browser is trying to download files. this is my file .host: 127.0.0.3 test this is apache2/sites-available/default file < VirtualHost 127.0.0.3:80 ServerName test DocumentRoot "/home/m/Pr/workspace/php/test/web" DirectoryIndex frontend_dev.php < Directory "/home/m/Pr/workspace/php/test/web" AllowOverride All Allow from All Alias /sf /home/m/Pr/workspace/php/test/lib/vendor/symfony/data/web/sf < Directory "/home/m/Pr/workspace/php/test/lib/vendor/symfony/data/web/sf" AllowOverride All Allow from All </Directory> and this is .htaccess in /test RewriteEngine On RewriteRule ^(.*)$ /web/$1 Options +FollowSymLinks +ExecCGI AddHandler application/x-httpd-php5 .php .phtml and this is .htaccess in /test/web Options +FollowSymLinks +ExecCGI RewriteEngine On # uncomment the following line, if you are having trouble # getting no_script_name to work RewriteBase / # we skip all files with .something #RewriteCond %{REQUEST_URI} ..+$ #RewriteCond %{REQUEST_URI} !.html$ #RewriteRule .* - [L] # we check if the .html version is here (caching) RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f # no, so we redirect to our front web controller RewriteRule ^(.*)$ index.php [QSA,L] Another problem is I think apache don't read .htaccess files. What am i doing wrong? Maybe I forgot about something? Please, help me becouse i have no idea.

    Read the article

  • How Do I make a simple .htaccess internal redirect Catch All script while forwarding POST data?

    - by RB
    I just want to catch all requests and forward them internally to my catchall page with all POST data intact Catch all page: http://www.mydomain.com/addons/redirect/catch-all.php I've tried so many combinations, but my server doesn't want to redirect internally if I specify more than catch-all.php # Internally redirect all pages to "Catch" page Options +FollowSymLinks RewriteEngine on RewriteRule (.*) /addons/redirect/catch-all.php [L] Also, do I need [L] or is it useless for internal redirects? Then, what php code would I use to grab the POST data, use it, and finally PHP redirect the page to the originally requested page Would it be done just as normal by using $_POST['variable_name']; or something different? Then, how would I go about calling the originally requested page, so I can tell PHP to header location direct them to that page? Thanks! UPDATE: Ha sick, nevermind. The condition DOES work. Here's my code: # Internally redirect all pages to "Catch" page Options +FollowSymLinks RewriteEngine on RewriteCond %{REQUEST_URI} !^/robots.txt$ RewriteCond %{REQUEST_URI} !\.(gif¦jpe?g¦png¦css¦js¦pdf¦doc¦xml)$ RewriteCond %{REQUEST_URI} !^/addons/redirect/catch-all\.php$ RewriteRule (.*)$ /addons/redirect/catch-all.php?q=$1 [L] Thanks guys for the inspiration! Now time to get that PHP to work...

    Read the article

  • mod_rewrite/GoDaddy problem

    - by John Deerhake
    Ok, so I really don't know much about mod_rewrite and I'm looking over the apache docs and still not figuring this out. Here is my htaccess (which is mostly just copy & pasted from a site I found): .htaccess in base dir: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ public/ [L] RewriteRule (.*) public/$1 [L] </IfModule> .htaccess in /public dir: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?url=$1 [PT,L] </IfModule> Basically I'm using the above htaccess files on my current test server and it works great and exactly like I would expect (everything gets seamlessly redirected to public dir). Now when I throw this on my GoDaddy hosting account i get "Internal Server Errror". I've done some searching and I'm fairly certain I should be able to use mod_rewrite with GoDaddy. I suspect this is because I'm not using the base directory to host the site in. The site is in in the folder html/myapp/ (where html is the base directory) and i have a subdomain set up in GoDaddy to look in that folder.

    Read the article

  • 404 Not Found When Requesting URI With Encoded Patameters

    - by Richard Knop
    I am pretty sure this is some problem with the Apache configuration because it used to work on the previous hosting provider with the same PHP/MySQL configuration. In my application, users are able to delete photos by going to URIs like this: http://example.com/my-account/remove-media/id/9/ret/my-account%252Fedit-album%252Fid%252F1 The paramater id is an id of a photo to be removed, the parameter ret is a relative URL where user should be redirected after the removal of the photo but after clicking on a link like that I get 404 Not Found error with the text: Not Found The requested URL /public/my-account/remove-media/id/9/ret/my-account/edit-album/id/1 was not found on this server. Though it used to work on my previous hosting provider so I guess it is just some easy Apache configuration issue? One more thing, there is a htaccess file that changes the document root to /public: RewriteEngine On php_value upload_max_filesize 15M php_value post_max_size 15M php_value max_execution_time 200 php_value max_input_time 200 # Exclude some directories from URI rewriting #RewriteRule ^(dir1|dir2|dir3) - [L] RewriteRule ^\.htaccess$ - [F] RewriteCond %{REQUEST_URI} ="" RewriteRule ^.*$ /public/index.php [NC,L] RewriteCond %{REQUEST_URI} !^/public/.*$ RewriteRule ^(.*)$ /public/$1 RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^.*$ - [NC,L] RewriteRule ^public/.*$ /public/index.php [NC,L] In the public folder there is a second htaccess file for MVC: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond %{REQUEST_FILENAME} -l [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*$ - [NC,L] RewriteRule ^.*$ /index.php [NC,L] # Turn off magic quotes #php_flag magic_quotes_gpc off

    Read the article

  • Rewrite a URL that's already been redirected?

    - by Jack
    Hi guys, I'm running an Apache2 web server with a dynamic IP address. I bought exampledomain.net, and I use no-ip.com's domain-update service to redirect any visitors to my current ip address (endnote #1). For example, someone visits exampledomain.net and they get redirected to 73.181.57.34. It works like a charm. However, it isn't all that user-friendly. Can I rewrite the redirected, ip-address URL? I tried these rewrite rules in the root folder's .htaccess... RewriteEngine On RewriteCond %{HTTP_HOST} ^73\.181\.57\.34:88 RewriteRule ^(.*)$ http://www.exampledomain.net/$1 [L,NC] # I simplified the RewriteCond. I would use regex in a real situation. Of course, this creates an infinite loop. The user visits www.exampledomain.net. They're redirected to 73.181.57.34:88 by no-ip. Apache redirects them to www.exampledomain.net which redirects them back to 73.181.57.34:88... so on and so forth. I'm a noob when it comes to rewriting, but is there a way to rewrite a URL without redirecting? I tried these rewrite rules too (a shot in the dark)... RewriteEngine On RewriteCond %{HTTP_HOST} ^73\.181\.57\.34:88 RewriteRule ^(.*)$ my.exampledomain.net/$1 [L,NC] # I'd read that Apache replied with a redirect header when you include http Thanks! (1) No-IP works like this: You download and install their dynamic update client on your server. Every couple of minutes it polls your server for its current external ip address. If it's changed, it updates your server's ip address in no-ip's records.

    Read the article

  • .htaccess Redirect Loop, adding multiple .php extensions

    - by Ryan Smith
    I have sort of a small parent/teacher social network set up for my school. I use my .htaccess file to make the links to teacher profiles cleaner and to add a trailing slash to all urls. I get this problem when going to /teachers/teacher-name/ the link (sometimes) redirects to /teachers/teacher-name.php.php.php.php.php.php.php.php... Below is my .htaccess file. Sometimes if I clear my browser cache in Chrome it temporarily fixes it. I can't exactly wright .htaccess syntax, but I'm pretty familiar with it. Any suggestions are appreciated! RewriteEngine on RewriteBase / #remove php ext RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^([^/]+)/$ $1.php RewriteRule ^([^/]+)/([^/]+)/$ $1/$2.php #force trailing slash/ RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)([^/])$ /$1$2/ [L,R=301] #other rewrites RewriteRule ^teachers/([^/\.]+)/$ /teachers/profile.php?u=$1 RewriteRule ^teachers/([^/\.]+)/posts/$ /teachers/posts.php?u=$1 RewriteRule ^teachers/([^/\.]+)/posts/([^/\.]+)/$ /teachers/post.php?u=$1&p=$2 RewriteRule ^gallery/([^/\.]+)/$ /gallery/album.php?n=$1 RewriteRule ^gallery/([^/\.]+)/slideshow/$ /gallery/slideshow.php?n=$1 RewriteRule ^gallery/([^/\.]+)/([^/\.]+)/([^/\.]+)/$ /gallery/photo.php?a=$1&p=$2&e=$3 EDIT:I have attached a screenshot of exactly what I'm talking about.

    Read the article

  • ModRewrite weird redirect behavior on removing WWW

    - by vitto
    Hi, I'm trying to use some rule on my project to remove www from the beginning of the URL but I've some problem. my server structure is: domain.com/beta_folder domain.com/beta_folder/page+type domain.com/beta_folder/page+type/content+name domain.com/beta_folder/page+type/content+name/edit domain.com/beta_folder/page+type/content+name/etc. domain.com/beta_folder/.htaccess //here is where my htaccess is beta_folder is the site folder, and content+name are content vars, created to retrieve pages from the database. the site works perfect with this rules RewriteEngine On RewriteRule ^(page\+type/)([a-zA-Z0-9_+-]+)[/]?$ page_folder/page.php?varname=$2 My intention was to remove www, so I've added this rule but it isn't effective RewriteEngine On RewriteCond %{HTTP_HOST} ^www.domain.com$ [NC] RewriteRule ^(.*)$ http://domain.com$1 [R=301,L] RewriteRule ^(page\+type/)([a-zA-Z0-9_+-]+)[/]?$ page_folder/page.php?varname=$2 My problem starts if I digit www in front of my domain name: this works http://domain.com/beta_folder/page+type/content+name if i write http://www.domain.com/beta_folder/page+type/content+name the rewrite rule redirect me at http://www.domain.compage+type/content+name if i remove the www rules, the problem still active unfortunately, I can't make a public test for my domain basically, if I write http://www.domain.com/beta_folder the rules sends me to http://domain.com/ where I'm wrong?

    Read the article

  • .htacces Rewrite Rule to Keep .php File Extensions

    - by user2672112
    I'm upgrading my static website that had .php extensions on the content pages. I've created my own simple cms which will start retrieving data from mysql database from now on, keeping the url structure same as the old once. The cms has get function to retrieve url structure from the database. Overall it started working fine with .html when i tested. But when i change the .html extension to .php in my .htaccess code the content pages starts reflecting "Internal Server Error. The server encountered an internal error or misconfiguration and was unable to complete your request." Here is my .htaccess code which i've used: RewriteBase / Options +FollowSymLinks RewriteEngine On RewriteRule ^([^?]*).php$ content.php?pid=$1 Perhaps there is a conflict, here is the code with .html extension that actually works fine. RewriteBase / Options +FollowSymLinks RewriteEngine On RewriteRule ^([^?]*).html$ content.php?pid=$1 So basically, content pages with .html are working & .php are not working. But i need my content pages to be with .php Please help. Thanks in advance... :)

    Read the article

  • CodeIgniter site in subdirectory, htaccess file maybe interfering with htaccess file in main directory?

    - by patricksayshi
    In my CodeIgniter site, navigating to any page but the index gives me this error: No input file specified. Googling around, it seems like the cause must have something to do with my .htaccess situation. The way this is set up, and maybe this can eventually change, is that my CI site is in a subdirectory of the main domain. The CI site and main domain each have their own .htaccess files. The CI htacess file is located in the applications folder: <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /SubDomain/index.php?$1 [L] </IfModule> And here's the main htaccess file is two levels up from the CI one, reading thusly: RewriteEngine on RewriteCond %{SERVER_PORT} 80 rewriterule ^(.*)$ https://www.MainDomain.org/$1 [r=301,nc] I am afraid these two sets of re-write rules are conflicting with each other and I really have no idea what to do about it. I can alter either htaccess file and would really like to get them working together in peace and harmony. It's also possible, however, that this has nothing whatsoever to do with htaccess. Also, it's hosted on GoDaddy.

    Read the article

  • cannot get FilesMatch and mod_rewrite working together

    - by neil
    Hello, I'm having a little difficulty with my .htaccess when combining a password protection on a file and a mod_rewrite: If I only have this as my .htaccess <FilesMatch "manage.php"> AuthName "Member Only" AuthType Basic AuthUserFile /home/myuser/.htpasswd require valid-user </FilesMatch> It password protects manage.php fine. If I have this as my .htaccess RewriteEngine on RewriteCond $1 !^(index\.php|manage\.php|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] It works as expected: robots.txt, index.php and manage.php are left alone and are called as normal, everything else is redirected to index.php/$1 HOWEVER, If I combine them then when I visit manage.php it gets redirected as index.php/$1, i.e. the FilesMatch is causing the entry in rewritecond to be ignored. If I actually enter a password in the original test and get to the file, it works in this last test. So I guess something is up with the rewrite and the file match. i.e. entering this causes .\manage.php to be called as .\index.php\manage.php <FilesMatch "manage.php"> AuthName "Member Only" AuthType Basic AuthUserFile /home/myuser/.htpasswd require valid-user </FilesMatch> RewriteEngine on RewriteCond $1 !^(index\.php|manage\.php|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] Thanks for any help :)

    Read the article

  • Globally define parts of virtualhost definition to reduce redundancy

    - by user1428900
    I have setup an apache server and this apache server points to a bunch of virtualhosts. The definition of the virtualhosts are as follows, <VirtualHost *:80> ServerName <url> RewriteEngine on ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] # Enable client-side caching of resources ExpiresActive On ExpiresByType image/png "now plus 48 hours" ExpiresByType image/jpeg "now plus 48 hours" ExpiresByType image/gif "now plus 48 hours" ExpiresByType application/javascript "now plus 48 hours" ExpiresByType application/x-javascript "now plus 48 hours" ExpiresByType text/javascript "now plus 48 hours" ExpiresByType text/css "now plus 48 hours" </VirtualHost> . . . <VirtualHost *:80> ServerName <url> RewriteEngine on ReWriteCond %{SERVER_PORT} !^443$ RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] # Enable client-side caching of resources ExpiresActive On ExpiresByType image/png "now plus 48 hours" ExpiresByType image/jpeg "now plus 48 hours" ExpiresByType image/gif "now plus 48 hours" ExpiresByType application/javascript "now plus 48 hours" ExpiresByType application/x-javascript "now plus 48 hours" ExpiresByType text/javascript "now plus 48 hours" ExpiresByType text/css "now plus 48 hours" </VirtualHost> I have a ton of virtual host definitions similar to the examples shown above. Since, most of the definitions other than the ServerName are the same, I was wondering if there was a way to define these common definitions globally. I am new to apache configuration and I felt that as the number of virtualhost definitions increase my configuration file becomes longer and redundant.

    Read the article

  • mod rewrite regex

    - by bbutle01
    The plan is to take domain.com/chat2/roomnumber and redirect to domain.com/chat2/index.php?room_id=roomnumber. Here's my code that's NOT workin: RewriteEngine on RewriteRule ^/chat2/([a-z0-9_-]+)/$ /index.php?room_id=$1 [NC,L] RewriteRule ^/chat2/([a-z0-9_-]+)$ /index.php?room_id=$1 [NC,L] I get sent to the 404 page. I'm guessing the problem is my placement of the ^ but I'm not certain.

    Read the article

  • Internal server 500 error

    - by sanders
    Hello Everyone I have created the following script in my .htaccess file Options +FollowSymlinks RewriteEngine on RewriteCond %{HTTP_HOST} domain.eu RewriteCond %{REQUEST_URI} !^domain RewriteRule ^(.*)$ domain/$1 [L] This script should redirect domain.eu to the domain folder. But when I upload this script i get the internal server 500 error. Any idea's what goes wrong? Thanks

    Read the article

  • How to port Apache rewrite rules to cherokee?

    - by saint
    I'm pretty new to cherokee, it's great and pretty straight forward except URL Rewrites. Is there a straight forward guide to it? Let me know. Also how would I port this: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] Thanks

    Read the article

  • Redirect 404 errors without rewriting the URL

    - by Knocks X
    Is it possible to have an erroneous URL remain in the address bar while redirecting the user to a URL within my domain? I want www.domain.com/forum to be the actual site being served in all 404 circumstances but I don't want the referring URL to be rewritten (other than the domain portion, which is being done on the registrar level). This is my current .htaccess RewriteEngine On RedirectMatch permanent ^/$ http://www.domain.com/forum/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* http://www.domain.com/forum/ [L,R]

    Read the article

  • Rewrite a Wordpress URL on .htaccess

    - by Rifki
    I'm using this permalink structure on my wordpress site : mysitedotcom/2011/09/mypost and i'm using rewrite rule to visit another site on .htaccess, <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ([0-9]+)/([0-9]+)/(.*)/visit visit-site.php?siteurl=$3 [NC] </IfModule> so i can visit the site with this link mysitedotcom/2011/09/mypost/visit, sometime i want to change my permalink with structure like mysitedotcom/item/mypost when i can visiting another site with mysitedotcom/item/mypost/visit, please help me to change the .htaccess code above so I can access with mysitedotcom/item/mypost/visit link.

    Read the article

  • .htaccess working on remote server but does not work on localhost. Getting 404 errors on localhost

    - by Afsheen Khosravian
    MY PROBLEM: When I visit localhost the site does not work. It shows some text from the site but it seems the server can not locate any other files. Here is a snippet of the errors from firebug: "NetworkError: 404 Not Found - localhost/css/popup.css" "NetworkError: 404 Not Found - localhost/css/style.css" "NetworkError: 404 Not Found - localhost/css/player.css" "NetworkError: 404 Not Found - localhost/css/ui-lightness/jquery-ui-1.8.11.custom.css" "NetworkError: 404 Not Found - localhost/js/jquery.js" It seems my server is looking for the files in the wrong places. For example, localhost/css/popup.css is actually located at localhost/app/webroot/css/popup.css. I have my site setup on a remote server with the same exact configurations and it works perfectly fine. I am just having this issue trying to run the site on my laptop at localhost. I edited my VirtualHosts file DocumentRoot and to /home/user/public_html/site.com/public/app/webroot/ and this reduces some errors but I feel that this is wrong and sort of hacking it since I didn't use these setting on my production server which works. The last note I want to make is that the website uses dynamic URLs. I dont know if that has anything to do with it. For example, on the production server the URLS are: site.com/#hello/12321. HERES WHAT I AM WORKING WITH: I have a LAMP server setup on my laptop which runs on Ubuntu 11.10. I have enabled mod_rewrite: sudo a2enmod rewrite Then I edited my Virtual Hosts file: <VirtualHost *:80> ServerName localhost DirectoryIndex index.php DocumentRoot /home/user/public_html/site.com/public <Directory /home/user/public_html/site.com/public/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> </VirtualHost> Then I restarted apache. My website is using cakePHP. This is the directory structure of the website: "/home/user/public_html/site.com/public" contains: index.php app cake plugins vendors These are my .htaccess files: /home/user/public_html/site.com/public/app/.htaccess: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ webroot/ [L] RewriteRule (.*) webroot/$1 [L] </IfModule> /home/user/public_html/site.com/public/app/webroot/.htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] </IfModule>

    Read the article

  • URL Rewriting Problem

    - by Eray
    I'm trying to rewrite my URL's subdomain. http://username.domain.com will show content of http://www.domain.com/user.php?u=username but URL stay as http://username.domain.com . (I mean url masking) (Username's can contain a-z 0-9 and hypens) Also if subdomain is www or api, don't redirect them I'm using this for my .htaccess RewriteEngine on RewriteCond %{REQUEST_URI} !^/index\.php$ RewriteCond %{HTTP_HOST} !^www\.domain\.com RewriteCond %{HTTP_HOST} ^([^.]+)\.domain\.com RewriteRule .* /user.php?u=%1 [L] (After @mfarver's advice) I'm trying this RewriteEngine on RewriteRule .* /user.php?u=%1 [L] but this time getting 500 Internal Server error: [Mon May 30 20:10:44 2011] [alert] [client 81.6.xx.xxx] /home/blablabla/public_html/.htaccess: AllowOverride not allowed here (from error log) My server's httpd.conf file's virtualhost settings <VirtualHost 109.73.70.169:80> <IfModule mod_userdir.c> UserDir disabled UserDir enabled USERNAME </IfModule> <IfModule concurrent_php.c> php4_admin_value open_basedir "/home/USERNAME/:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp" php5_admin_value open_basedir "/home/USERNAME/:/usr/lib/php:/usr/local/lib/php:/tmp" </IfModule> <IfModule !concurrent_php.c> <IfModule mod_php4.c> php_admin_value open_basedir "/home/USERNAME/:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp" </IfModule> <IfModule mod_php5.c> php_admin_value open_basedir "/home/USERNAME/:/usr/lib/php:/usr/local/lib/php:/tmp" </IfModule> <IfModule sapi_apache2.c> php_admin_value open_basedir "/home/USERNAME/:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp" </IfModule> </IfModule> ServerName DOMAIN.net ServerAlias *.DOMAIN.net <Directory "/home/USERNAME/public_html"> Options FollowSymLinks Allow from all AllowOverride All </Directory> DocumentRoot /home/USERNAME/public_html ServerAdmin [email protected] UseCanonicalName Off CustomLog /usr/local/apache/domlogs/DOMAIN.net combined CustomLog /usr/local/apache/domlogs/DOMAIN.net-bytes_log "%{%s}t %I .\n%{%s}t %O ." ## User USERNAME # Needed for Cpanel::ApacheConf <IfModule mod_suphp.c> suPHP_UserGroup USERNAME USERNAME </IfModule> <IfModule !mod_disable_suexec.c> SuexecUserGroup USERNAME USERNAME </IfModule> ScriptAlias /cgi-bin/ /home/USERNAME/public_html/cgi-bin/ # To customize this VirtualHost use an include file at the following location # Include "/usr/local/apache/conf/userdata/std/2/USERNAME/DOMAIN.net/*.conf" </VirtualHost> Also *.DOMAIN.net added to my DNS ZONES as A record.

    Read the article

  • htaccess for multiple domains

    - by toomanyairmiles
    I have three domains which share a common root directory, wordpress is installed on domain 1 which results in domains 2 and 3 generating 404/500 error pages from domain 1. Is there a way to correct the error? Current htaccess # 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

    Read the article

  • Helicon ISAPI_REWRITE 3 - Not Logging Anything

    - by Brian
    Hello, The ISAPI_REWRITE Helicon product does not log anything... I setup logging to run as: [ISAPI_Rewrite] RewriteEngine on #enabling rewrite.log RewriteLogLevel 9 #enabling error.log LogLevel debug But nothing is getting logged. Is it something I'm doing, is it working? It is installed, it's given high priority in IIS (do see it visibly present). Any ideas why it isn't logging? Should it log even if not rewriting?

    Read the article

  • Looking to use .htaccess to create SEO friendly URLs

    - by Ray
    For SEO purposes, I need someone to modify my .htaccess file. Here's what I need to do: current URL: http://www.abc.com/index.php?page=show_type&ord=1 to new URL: http://www.abc.com/amazing Please note that that if someone types in http://www.abc.com/amazing, they must be served content from the current URL, but the new URL must stay in the address bar. I tried this and it didn't seem to work RewriteEngine On RewriteRule ^/?amazing/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)/ /index.php?page=show_type&ord=1

    Read the article

  • dynamic subdomains problem?

    - by Solomon Saleh
    im trying to add a wildcard subdomain system to my webserver, but its still not working, this is the steps i took: i made a new file vhost.conf in the directory var/www/vhosts/www.kornar.com/conf/vhost.conf and i put ServerAlias *.domain.com then second of all i made a new dns wildcard on plesk CNAME *.domain.com kornar.com and then i edited my .htaccess file Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^(^.*)\.kornar.com RewriteRule (.*) user.php?user=%1 normally my url would be http://www.kornar.com/user.php?user=solomon but now i want to like this http://solomon.kornar.com but the steps i took still deosnt work :)) whats happening here

    Read the article

  • Apache2 graceful restart stops proxying requests to passenger

    - by Rob
    Issue with apache mod proxy, it stops proxying requests after a graceful restart but not all the time. It seems to happen only on a Sunday when a graceful restart is triggered by logrotate. [Sun Sep 9 05:25:06 2012] [notice] SIGUSR1 received. Doing graceful restart [Sun Sep 9 05:25:06 2012] [notice] Apache/2.2.22 (Ubuntu) Phusion_Passenger/3.0.11 configured -- resuming normal operations [Sun Sep 9 05:25:06 2012] [error] proxy: ap_get_scoreboard_lb(492) failed in child 26153 for worker proxy:reverse [Sun Sep 9 05:25:06 2012] [error] proxy: ap_get_scoreboard_lb(486) failed in child 26153 for worker http://api.myservice.org/api [Sun Sep 9 05:25:06 2012] [error] proxy: ap_get_scoreboard_lb(487) failed in child 26153 for worker http://api.myservice.org/editor/$1 [Sun Sep 9 05:25:06 2012] [error] proxy: ap_get_scoreboard_lb(489) failed in child 26153 for worker http://api.myservice.org/build [Sun Sep 9 05:25:06 2012] [error] proxy: ap_get_scoreboard_lb(490) failed in child 26153 for worker http://api.myservice.org/help [Sun Sep 9 05:25:06 2012] [error] proxy: ap_get_scoreboard_lb(491) failed in child 26153 for worker http://api.myservice.org/motd.html [Sun Sep 9 05:25:06 2012] [error] proxy: ap_get_scoreboard_lb(480) failed in child 26153 for worker http://api.myservice.org/api [Sun Sep 9 05:25:06 2012] [error] proxy: ap_get_scoreboard_lb(481) failed in child 26153 for worker http://api.myservice.org/editor/$1 [Sun Sep 9 05:25:06 2012] [error] proxy: ap_get_scoreboard_lb(483) failed in child 26153 for worker http://api.myservice.org/build [Sun Sep 9 05:25:06 2012] [error] proxy: ap_get_scoreboard_lb(484) failed in child 26153 for worker http://api.myservice.org/help [Sun Sep 9 05:25:06 2012] [error] proxy: ap_get_scoreboard_lb(485) failed in child 26153 for worker http://api.myservice.org/motd.html [Sun Sep 9 05:25:06 2012] [error] proxy: ap_get_scoreboard_lb(479) failed in child 26153 for worker http://api.myservice.org/motd.html After these lines, the logs are flooded with 404's because the requests are not being proxied. It's worth noting that the destination is just another vhost on the same apache instance, but the vhost (http://api.myservice.org) is serving passenger (mod_rails) I was thinking that maybe there's some startup issues with the passenger workers not being ready during a graceful restart? After a full restart resolves it and everything returns to normal. //Edit Here's the vhost config, thanks :) <VirtualHost *:80> UseCanonicalName Off LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon <Directory /var/www/vhosts> RewriteEngine on AllowOverride All </Directory> RewriteEngine on RewriteCond /var/www/vhosts/%{SERVER_NAME} !-d RewriteCond /var/www/vhosts/%{SERVER_NAME} !-l RewriteRule ^ http://sitenotfound.myservice.org/ [R=302,L] VirtualDocumentRoot /var/www/vhosts/%0/current # Rewrite requests to /assets to map to the /var/file-store/<SERVER_NAME>/ RewriteMap lowercase int:tolower RewriteCond %{REQUEST_URI} ^/assets/ RewriteRule ^/assets/(.*)$ /var/file-store/${lowercase:%{SERVER_NAME}}/$1 # Map /login to /editor.html as it's far friendlier. RewriteCond %{REQUEST_URI} ^/login RewriteRule .* /editor.html [PT] # Forward some requests to the API ProxyPass /api http://api.myservice.org/api ProxyPass /site.json http://api.myservice.org/api/editor/site ProxyPassMatch ^/editor/(.*)$ http://api.myservice.org/editor/$1 ProxyPassMatch ^/api/(.*) http://api.myservice.org/api/$1 ProxyPass /build http://api.myservice.org/build ProxyPass /help http://api.myservice.org/help ProxyPass /motd.html http://api.myservice.org/motd.html <Proxy *> Order allow,deny Allow from all </Proxy> # TODO generate slightly more specific Error Documents for 401/403/500's, # but for now the 404 page is good enough ErrorDocument 401 /404.html ErrorDocument 403 /404.html ErrorDocument 404 /404.html ErrorDocument 500 /404.html </VirtualHost>

    Read the article

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