Jump to content

Help with moving pages from root to a sub folder.


CaesarGdi

Recommended Posts

I am testing a script that I may use on my site.  The script assumes that all folder/file are in the root folder but I have them in a /dev folder.  I tried editing the Mod_Rewrite script but it is still trying to open the files on root.  Here is an example of the code.

 

Orginal Code

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/workplace/(.*)
RewriteCond %{REQUEST_URI} !^/media/(.*)
RewriteCond %{REQUEST_URI} !^/cre/cre\.php
#just a dir
RewriteCond %{REQUEST_URI} !^(.*)0\.(.*)\.(.*)\.(.*)\.html
RewriteRule ^(.*) /cre/cre.php?path=$1 [L]
#normal file
RewriteRule ^(.*)0\.(.*)\.(.*)\.(.*)\.html /cre/cre.php?path=$1&vfsid=$2&page=$3&option=$4 [L]

 

Modified Code

RewriteEngine On
RewriteBase /dev/
RewriteCond %{REQUEST_URI} !^/dev/workplace/(.*)
RewriteCond %{REQUEST_URI} !^/dev/media/(.*)
RewriteCond %{REQUEST_URI} !^/dev/cre/cre\.php
#just a dir
RewriteCond %{REQUEST_URI} !^(.*)0\.(.*)\.(.*)\.(.*)dev\.html
RewriteRule ^(.*) /dev/cre/cre.php?path=$1 [L]
#normal file
RewriteRule ^(.*)0\.(.*)\.(.*)\.(.*)\.html /dev/cre/cre.php?path=$1&vfsid=$2&page=$3&option=$4 [L]

 

I apologize and hope this makes since but I am very new to php and Mod_Rewrites.

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.