Tag Info

Hot answers tagged

5

Empty Virtual Host With virtual hosting, all traffic is routed to an IP address and then Apache matches the hostname. When virtual hosting using NameVirtualHost is enabled, the site that responds to the IP address is the first one listed in the Apache configuration file. So you can use a null virtualhost: <VirtualHost 192.168.1.1:80> ...


4

Regarding: "Is this ok?" No, its not good/intuitive for your users and hence not good for SEO. You should be using something like this www.alanmarth.com/ (Main Page) www.alanmarth.com/servicios (Services) www.alanmarth.com/blog (Recent news) www.alanmarth.com/blog/nameOfCategory2 (News category) www.alanmarth.com/blog/titleOfBlog3 (A single entry) ...


3

Something similar to the rewrite rules from Jon Lin's StackOverflow answer to Remove Characters from URL with htaccess should solve your problem. I would use this which should rewrite the URL to not have the characters, and then redirect: RewriteRule ^(.*)\'(.*)$ /$1$2 [L] RewriteRule ^(.*)\’(.*)$ /$1$2 [L] RewriteCond %{ENV:REDIRECT_STATUS} 200 ...


2

Your root .htaccess should look like this: # Mod RewriteRules, some 12 in all RewriteRule ^mod/(.*)$ /moderator/$1 [NC,L] RewriteRule ^signup/(.*)$ /acc/signup/$1 [NC,L] RewriteRule ^signin/(.*)$ /acc/signin/$1 [NC,L] RewriteRule ^signout/(.*)$ /acc/signout/$1 [NC,L] # These are the only two that a front end user will use # category/subCategory ...


2

You can use these three rewrite rules which handle up to 3 levels of directories: RewriteEngine on RewriteRule ^main\/([^\/]+)\/([^\/]+)\/([^\/]+)\/? /parser.php?var1=$1&var2=$2&var3=$3 [L] RewriteRule ^main\/([^\/]+)\/([^\/]+)\/? /parser.php?var1=$1&var2=$2 [L] RewriteRule ^main\/([^\/]+)\/? /parser.php?var1=$1 [L] In those regular ...


2

I think the following would work: RewriteRule ^/index\.php/rss/rss1klik$ /index.php?option=com_obrss&task=feed&id=2:rss1klik&format=feed&Itemid=160 [L] But this may look better: RewriteRule ^/rss/rss1klik$ /index.php?option=com_obrss&task=feed&id=2:rss1klik&format=feed&Itemid=160 [L] Then the URL would be ...


2

I suspect you are over thinking this. I am really confused over all your code. One of the things I am finding these days is that people are using example code that is already unnecessarily complicated. As well, people seem to select {???} that offers too much instead of the narrowest selection. Often these things only require 2 lines or 3 at the most and ...


2

If your .htaccess has RewriteRules like these: RewriteRule page.html /another-page.html [NC,R=301,L] It will always remove querystring parameters, that's default behaviour. You'll have to add QSA flag to your RewriteRule, like this: RewriteRule page.html /another-page.html [NC,QSA,R=301,L] Apache mod_rewrite doc QSA|qsappend


2

You could simply redirect the user to the named host: # Uncomment the line below if not previously added in the file # RewriteEngine On # Rule to redirect to the named host # Replace [xx.xx.xx.xx] woth your host's IP address # Replace [yourdomain.com] with your host's proper URL RewriteCond %{HTTP_HOST} ^xx\.xx\.xx\.xx$ RewriteRule (.*) ...


2

This may not really be an answer to your question, but the best way to make a multilingual is in most cases by using some simple PHP. Create a folder called languages and create the files lang.code.php. Replace code with, for example EN for English, DE for German, etc. Create a language switcher with the following code: <?php $lang = "en"; if( isset( ...


2

Edit 2 Based on @w3d comment and more information provided by Mayeenul: Replace your regex: RewriteRule ^[0-9]+/([^/]+/[^/]+/?)$ /$1 [L,R=301,NE] with this one: Add this new rule: RewriteRule ^([^/]+)/([^/]+)/page/[0-9]+/?$ /$1/$2/ [R=301,L] So your .htaccess should look like: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On ...


1

This should do it. RewriteEngine On RewriteRule social(.*) https://twitter.com$1 [R=301,L]


1

As far as I know, there is no specific needs to put your files on root. If you think your users will get benefited with this practice, go for it. My Suggestion: Keep your default language on your root domain. For example your main target audience is En, keep English version at root. For other language, create sub-folders.


1

I believe this will start you off right: I don't believe the rewrite rule is necessary, when the default page for WordPress is index.php Options +FollowSymLinks RewriteEngine on Redirect 301 ^/home.html http://www.mscaspian.com/fa Update Localizing WordPress List of Localization Plug-Ins I am not affiliated in any way to the list of plug-ins ...


1

Since I helped you with the htaccess file yesterday, I need to offer some advice here: Do not use Jaun's rule as a workaround. Leave both sites up, so the HTML based site stays indexed while you work on the WordPress Conversion. Sign Up for Google Webmaster Tools, and add both sites to your sitelist. Finish the WordPress Conversion, and remove the HTML ...


1

I believe the problem is with your regular expression This sould work fine: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.html [NC,L]


1

I would be surprised if they had mod_proxy enabled on their shared hosting servers. The amount of abuse that would open them up to would be quite high. If you are on your own VPS instance then you can simply log in as root and issue the "a2enmod proxy_http" on debian/ubuntu and then restart apache. http://www.justhost.com/vps


1

As it stands, you are redirecting to the same host. ie. demo.example.com/file is redirecting to demo.example.com/my-demo/file, not example.com/my-demo/file, which is going to result in a redirect loop. You need to specify an absolute URL in the RewriteRule substitution: RewriteEngine On RewriteCond %{HTTP_HOST} =demo.example.com RewriteRule ^(.*)$ ...


1

Can you still access /wp-admin ? I fixed mine when it was doing this after migration by going to /wp-admin -> Permalinks -> set to the default (simple) page_id and then back to my date structure. This recreated the mod rewrite rules and it was OK after that.



Only top voted, non community-wiki answers of a minimum length are eligible