Jump to content

Problem with rewrite and alias


danbopes

Recommended Posts

This is the directory structure I have:

/var/www/demo1

/var/www/app

 

The document root for demo1.example.com goes to /var/www/demo1, (Virtual host), and I also have an Alias in demo1 (/app), to goto /var/www/app.

 

In my app folder, I have the following .htaccess file:

RewriteEngine on
RewriteCond $1 !^(index\.php|images|user_guide|assets|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

 

In essence /app/test, should redirect to /app/index.php/test. This is what I get tho:

 

404 Not Found:

/var/www/app/index.php/test

 

It does exist, but I think it's trying to tell the browser to go there, and it should be going to /app/index.php/test.

Link to comment
https://forums.phpfreaks.com/topic/250941-problem-with-rewrite-and-alias/
Share on other sites

The .htaccess in the previous step is incorrectly redirecting to /var/www/app/test.

What's that file look like?

 

And in the future, if you have a thread on a subject already then just keep using it until the problem is resolved. Don't need multiple threads for the same underlying problem.

This is a different issue entirely, no longer is about multiple mod_rewrites, it's about mod_alias working together with mod_rewrite.

 

<VirtualHost *:80>

  ServerName demo1.example.com

  ServerAlias www.demo1.example.com

  DocumentRoot "/var/www/demo1"

  Alias /app "/var/www/app"

</VirtualHost>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.