[SOLVED] .htaccess pretty urls for cmsms site and Wordpress sub-site

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Locked
ukmgranger
Forum Members
Forum Members
Posts: 72
Joined: Wed Apr 04, 2007 9:54 am

[SOLVED] .htaccess pretty urls for cmsms site and Wordpress sub-site

Post by ukmgranger »

Hi all,

I have a website that I build using cmsms.  I have also build a shop within this site using Wordpress.

so -
www.fourseasonsgolfcentre.co.uk = main site (cmsms)
www.fourseasonsgolfcentre.co.uk/shop = e-com shop (wordpress / wp-ecommerce)

I have pretty urls working in my cmsms installation using the code below in my .htaccess file:

Code: Select all

# Attempt to override some php settings, these settings may be helpful on some hosts if your
# default configuration does not meet CMS's minimum requirements, and your host
# has given your account appropriate permissions
#php_value upload_max_filesize "10M"
#php_value session_save_path "tmp/cache"

#php_flag magic_quotes_gpc Off
#php_flag register_globals Off
#php_flag session.use_trans_sid Off

# (this is important, so uncomment if your host permit)
#Options -Indexes
#ServerSignature Off
#
Options +FollowSymLinks
#
<IfModule mod_rewrite.c>
RewriteEngine on
#
#Sub-dir e.g: /cmsms
RewriteBase /
#
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
#RewriteCond %{REQUEST_URI} !/$
#RewriteCond %{REQUEST_URI} !\.
#RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA] 
</IfModule>
Wordpress is telling me to add the following to my .htaccess file:

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /shop/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /shop/index.php [L]
</IfModule>
the BIG question.

Is there any way of combining the two to get pretty urls working in both the cmsms site and the wordpress site?
Last edited by ukmgranger on Fri Jan 29, 2010 5:02 pm, edited 1 time in total.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: .htaccess pretty urls for cmsms site and Wordpress sub-site

Post by Dr.CSS »

Turn off the RewriteBase / in the root site one as it may cause problems...

As for wordpress pretty URLs you may want to go to their site/forum...
ukmgranger
Forum Members
Forum Members
Posts: 72
Joined: Wed Apr 04, 2007 9:54 am

Re: .htaccess pretty urls for cmsms site and Wordpress sub-site

Post by ukmgranger »

Thanks for that info!

I have now put a '#' in front of 'RewriteBase /' which I asume turns it off.

I guess the software being used doesn't really matter to my problem.

If I had two installations of cmsms (one under the other) would I need two instances the code in the .htaccess file to get both installations to have pretty url's?

Cheers
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: .htaccess pretty urls for cmsms site and Wordpress sub-site

Post by Dr.CSS »

If you have cmsms in root and cmsms/cmsms2 in subfolder put an htaccess file in the root with #RewriteBase / in subfolder use one with RewriteBase / cmsms2 ...
ukmgranger
Forum Members
Forum Members
Posts: 72
Joined: Wed Apr 04, 2007 9:54 am

Re: .htaccess pretty urls for cmsms site and Wordpress sub-site

Post by ukmgranger »

Awesome - cheers for the dude.

I didn't know that you could have a second .htaccess file in a sub dir.
Locked

Return to “The Lounge”