Solved

How to configure a mod_rewrite for CMSMS?

Posted on 2008-10-28
3
529 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Any business that wants to seriously grow needs to keep the needs and desires of an international audience of their websites in mind. Making a website friendly to international users isn’t prohibitively expensive and can provide an incredible return…
Does your audience prefer people in photos or no people? How can you best highlight what you’re selling? What are your competitors doing, and what can you do that is different and unique from them?  Continue reading to learn how to make your images …
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:
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…

786 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