Solved

How to configure a mod_rewrite for CMSMS?

Posted on 2008-10-28
3
526 Views
Last Modified: 2013-12-09
I'm using a CMS (CMSMS) that formats the links with the following structure when configured for mod_rewrite :
http://domain.tld/parent/content

This parent/content URL scheme is automatic and cannot be deactivated.

I've modified the CMS to take a language parameter into account, so now the URLs look like this :
http://domain.tld/langage/parent/content

What rewrite_rule should I use, knowing that when not using mod_rewrite, my CMS accepts these two arguments only :
index.php?hl=language&page=content
0
Comment
Question by:CPL593H
  • 2
3 Comments
 
LVL 27

Expert Comment

by:caterham_www
ID: 22823712
How does your current rewriteRule look like?

Basically it should look like
RewriteEngine on

RewriteRule ^([^/]+)/parent/(.*) /index.php?hl=$1&page=$2 [L]

Open in new window

0
 

Author Comment

by:CPL593H
ID: 22829244
Note that in CMSMS, the parent/content portion of the URL is automatically generated by parsing the page order and checking a page's parent.
When not using mod_rewrite, the parent/content mode is not used, only the content is being passed as an argument.

These are my current rewriteRules :
RewriteCond %{REQUEST_FILENAME} !-f [NC]

RewriteCond %{REQUEST_FILENAME} !-d [NC]

RewriteRule ^([^/]+)/(.*)$ index.php?page=$2&hl=$1 [QSA]

Open in new window

0
 

Accepted Solution

by:
CPL593H earned 0 total points
ID: 22848265
I found a solution to my problem.  It appears that the rewriteBase was not set in my .htaccess; thus redirecting URLs to the wrong directory.  The above RewriteRule is therefore correct and works very well.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Form submit issue 11 56
PHP foreach DB query 4 34
Summernote and form validation 10 47
Stupid git question 2 23
Envision that you are chipping away at another e-business site with a team of pundit developers and designers. Everything seems, by all accounts, to be going easily.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to count occurrences of each item in an array.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now