Solved

How to configure a mod_rewrite for CMSMS?

Posted on 2008-10-28
3
533 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

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

Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

615 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