Hello,
I have just set friendly urls for a website which is stored alongside other websites in the htdocs folder. Each folder name in htdocs corresponds to a domain name.The website can be directly accessed with its own domain name. So, "www.somewebsite.com" means "htdocs/somewebsite.com". Each domain-folder has its own ".htaccess" file.
Here, the code from the .htaccess file. Please ignore the anchor html tag as it was improperly added by the pluggin that is used to display the code.
Options +FollowSymlinks
RewriteEngine On
RewriteBase /
#AllowOverride all
# Force www.somewebsite.com instead of just somewebsite.com
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.somewebsite\.com [NC]
RewriteRule (.*) http://www.somewebsite.com/$1 [R=301,L]
# The Friendly URLs part
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Now, the friendly URL redirection is working, but the document id is still displaying in the address bar. For instance if the FURL alias for document # 123 is "hello-world", then "
http://www.somewebsite.com/hello-world" redirects to "
http://www.somewebsite.com/123".
In "Tools, Configuration, Friendly URLs", setting the "Access path for simple alias" to TRUE gave me some better result: "
http://www.somewebsite.com/hello-world/123".
But of course, I would like to get rid of the document id in the URL that is displayed.
Also, if possible, I would also like to keep the "Access path for simple alias" to FALSE, as I want to keep URLs short.
Maybe the problem comes from some folder offset when the website is not directly installed in htdocs, but how to solve it? Some MODX file to edit or RewriteRule to adapt?
I tried adapting RewriteBase from / to the domain folder and this gives an internal server error.
So, I assume that the RewriteBase is correctly set.
Thanks a lot for your help.
[ed. note: Jul last edited this post 11 years, 7 months ago.]